mirror of
https://github.com/django-q2/django-q2.git
synced 2026-09-15 13:37:56 +08:00
Allow timeout unit tests to fail properly
The old implementation used count_forever test task that never finishes. If the timeout implementation does not work in the test, the test never end and you was required to kill the test runner.
This commit is contained in:
@@ -252,7 +252,7 @@ def test_timeout(broker, cluster_config_timeout, async_task_kwargs):
|
||||
# set up the Sentinel
|
||||
broker.list_key = 'timeout_test:q'
|
||||
broker.purge_queue()
|
||||
async_task('django_q.tests.tasks.count_forever', broker=broker, **async_task_kwargs)
|
||||
async_task('time.sleep', 5, broker=broker, **async_task_kwargs)
|
||||
start_event = Event()
|
||||
stop_event = Event()
|
||||
# Set a timer to stop the Sentinel
|
||||
|
||||
Reference in New Issue
Block a user