mirror of
https://github.com/django-q2/django-q2.git
synced 2026-10-04 00:48:12 +08:00
#50 removes redis connection argument from pusher process
This commit is contained in:
@@ -85,7 +85,7 @@ def test_cluster(r):
|
||||
event = Event()
|
||||
event.set()
|
||||
# Test push
|
||||
pusher(task_queue, event, list_key=list_key, r=r)
|
||||
pusher(task_queue, event, list_key=list_key)
|
||||
assert task_queue.qsize() == 1
|
||||
assert queue_size(list_key=list_key, r=r) == 0
|
||||
# Test work
|
||||
@@ -148,7 +148,7 @@ def test_async(r, admin_user):
|
||||
stop_event.set()
|
||||
# push the tasks
|
||||
for i in range(task_count):
|
||||
pusher(task_queue, stop_event, list_key=list_key, r=r)
|
||||
pusher(task_queue, stop_event, list_key=list_key)
|
||||
assert queue_size(list_key=list_key, r=r) == 0
|
||||
assert task_queue.qsize() == task_count
|
||||
task_queue.put('STOP')
|
||||
@@ -292,8 +292,8 @@ def test_recycle(r):
|
||||
task_queue = Queue()
|
||||
result_queue = Queue()
|
||||
# push two tasks
|
||||
pusher(task_queue, stop_event, list_key=list_key, r=r)
|
||||
pusher(task_queue, stop_event, list_key=list_key, r=r)
|
||||
pusher(task_queue, stop_event, list_key=list_key)
|
||||
pusher(task_queue, stop_event, list_key=list_key)
|
||||
# worker should exit on recycle
|
||||
worker(task_queue, result_queue, Value('f', -1))
|
||||
# check if the work has been done
|
||||
@@ -322,7 +322,7 @@ def test_bad_secret(r, monkeypatch):
|
||||
assert len(stat) == 0
|
||||
assert Stat.get(s.parent_pid, r) is None
|
||||
task_queue = Queue()
|
||||
pusher(task_queue, stop_event, list_key=list_key, r=r)
|
||||
pusher(task_queue, stop_event, list_key=list_key)
|
||||
result_queue = Queue()
|
||||
task_queue.put('STOP')
|
||||
worker(task_queue, result_queue, Value('f', -1), )
|
||||
|
||||
@@ -34,7 +34,7 @@ def test_scheduler(r):
|
||||
stop_event = Event()
|
||||
stop_event.set()
|
||||
# push it
|
||||
pusher(task_queue, stop_event, list_key=list_key, r=r)
|
||||
pusher(task_queue, stop_event, list_key=list_key)
|
||||
assert task_queue.qsize() == 1
|
||||
assert queue_size(list_key=list_key, r=r) == 0
|
||||
task_queue.put('STOP')
|
||||
|
||||
Reference in New Issue
Block a user