Commit Graph

351 Commits (009c478822251771202009de7c15d2d6037d5010)

Author SHA1 Message Date
Samuel Colvin 423da3683c remove python 2.6 support
Theo ee64114e6e Fixed Improved test coverage for connections.py and utils.py
Selwin Ong 0efb87a46b Fixed test error in Python 3.
Selwin Ong 54bc04bb45 job.save() shouldn't crash on unpickleable return value.
Alexey Katichev 09697e567f revert back job.cleanup changes
Alexey Katichev 3596449cc0 remove implicit cleanup call from job.save
Alexey Katichev a0113c83cf introduce job.update_meta() to store updated meta to Redis ()
* introduce job.update_meta() to store updated meta to Redis

This closes 

* rename update_meta to save_meta
Selwin Ong dc45ab8799 Worker.find_by_key should use hmget instead of repeated hget calls. ()
luojiebin cd529d0ce1 Fixed issue#72 ()
* Added a custom exception for timeout transfer

* Added a util to transfer timeout to a united format

* Transfer timeout format when creating a queue or enqueue jobs

* Fixed typos

* Fixed bug in transfer_timeout function

* Added test for function transfer_timeout

* Updated transfer_timeout to allow uppercase unit

* Renamed function in utils
Peng Liu b7d4b4ec1b Solve the UnicodeDecodeError while decode literal things. ()
* Solve the UnicodeDecodeError while decode literal things.

* Add test case for when worker result is a unicode or str object that other than
pure ascii content.
Felipe Lacerda cab89254b5 Make `Queue.enqueue_job()` execute immediately if `async=False` ()
Currently, the job is being performed inside `enqueue_call()`, which
means that `async=False` has no effect if `enqueue_job()` is called
directly. This commit fixes that.
Selwin Ong f6b4c286c9 Merge pull request from jaywink/fix-unicode-decode-error
Fix UnicodeDecodeError when failing jobs
Selwin Ong f760fcb20f job.delete() should cleans itself from FailedQueue and various registries.
Samuel Colvin fd9babe8ce correct heroku worker exit logic
as per @Chronial's comment on b4b99f3
Jason Robinson 213969742e Fix UnicodeDecodeError when failing jobs
Worker handle_exception and move_to_failed_queue couldn't handle a situation where the exception raised had non-ascii characters. This caused a UnicodeDecodeError when trying to format the exception strings.

If on Python 2, ensure strings get decoded before building the exception string.

Closes 
Selwin Ong 83007b2074 Merge pull request from jezdez/backend-class-overrides
Allow passing backend classes from CLI and other APIs
Benjamin Root 30a7ab4899 Add similar test for when the job fails
Benjamin Root f68aeff481 Added integration test for the metadata persistence feature
Jannis Leidel c019662430
Allow passing backend classes (job, queue, worker, connection) from CLI and other APIs
This includes:

- a partial refactor of the CLI to organize the shared options
- extends the tests in areas where passing custom backend classes makes sense
- allow setting the core CLI options as env vars
- minor cosmetic changes here and there
Jannis Leidel 27e4f3a768
Small refactor to simplify registry key setup.
Samuel Colvin 763a304ec6 cope with python 2.6 yawwwwwwn
Samuel Colvin f50bdb31bf skip test_run_scheduled_access_self on pypy
Samuel Colvin b4b99f30b0 allow for already dead horse on heroku worker termination
Julien Surloppe dc3bba9362 Another check on failed status and test
Selwin Ong 2428370dfd Merge pull request from jezdez/skip-heroku-macos
Stop running some Heroku tests on macOS since it’s missing the appropriate signals
Jannis Leidel fcec17c8e1
Stop running some Heroku tests on macOS since it’s missing the appropriate signals
Refs issue .
Stefan Hammer f9bff3d12b Merge branch 'master' into 739_fix_race_condition
Vincent Driessen af6ce54ea4 Fix PEP8 complaints
Stefan Hammer a0cee2d2a0 refactored worker code
Moved code into a new handle_job_success() method and reduced context of used
pipelines.
Samuel Colvin afc7469c27 fetch_job - check correct queue, fix
Stefan Hammer 301e5c927b Raise an exception if a given dependency does not exist
Adapted some tests to the change: the dependency has to be saved first.
Stefan Hammer 44f98693c7 added a test for the race condition
Samuel Colvin bbf50f4893 use compat for PY2 test and add tests
Yannis Spiliopoulos 4a8aa0921f Set test timeout to original value
Yannis Spiliopoulos fbb29ec333 Investigating timeouts
Yannis Spiliopoulos 94d5caed15 Make clearer the puprose of test
Yannis Spiliopoulos 3362fe2ba5 Test killing work_horse after we start monitoring
Yannis Spiliopoulos c00d3681f9 Failing test to demonstrate issue
Test that demonstrates that if a work-horse process is terminated unexpectedly
the job being processed could be stuck at the "Started" state
(https://github.com/nvie/rq/issues/702)
Samuel Colvin 0e26db9e08 correct wording in docstring and tests
Samuel Colvin 9f9c887645 better function names and process double SIGRTMIN
Samuel Colvin 2b544e5b17 add tests to HerokuWorker
Arnold Krille 8e99706b16 run python 3.5 on travis, adopt timeouts
Also
- Report the five slowest tests to watch for risk of timeout
- Double timeouts.
  Maybe that helps pypy on travis to finish successfully.
Arnold Krille df22f127eb Test the worker in its own subprocess
- run with an empty queue
- schedule one job (which uses get_current_connection and get_current_job) and
run `rqworker`
- schedule a job that itself schedules `access_self` and run `rqworker`
- Make sure the job didn't fail by assuring the failed queue is still empty
  afterwards.
- Install this package locally when running in travis.
  This actually unifies the behaviour of tox and travis as tox also builds the
  package and then installs it into each test environment.
- fix flake8 (as run by tox)
Javier Lopez e92b57d128 test_job.py: Add cancel test on failed queue
Selwin Ong 766bb60006 Merge branch 'dependent-jobs-with-result-ttl'
Selwin Ong e9d227c3df Dependent jobs are now correctly enqueued even if their parent jobs have result_ttl=0.
Selwin Ong 8b7b0e5584 Merge pull request from jlopex/javi/fix_issue_700
Fixes issue 
Javier Lopez 091c2568c9 test_job.py: Add test for cancel_job function
amyangfei 724c844378 Don't call job.cancel if job has finished
Arnold Krille 9df0a853d8 Fix indentation and newlines according to flake8