From 2650659da9706908dba81ef8a379aec31b75f286 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Janne=20R=C3=B6nkk=C3=B6?= Date: Sat, 26 Jan 2019 20:45:38 +0200 Subject: [PATCH] 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. --- django_q/tests/test_cluster.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/django_q/tests/test_cluster.py b/django_q/tests/test_cluster.py index 7ef208f..7dc0959 100644 --- a/django_q/tests/test_cluster.py +++ b/django_q/tests/test_cluster.py @@ -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