Skip to content

Commit

Permalink
add failing test for scheduling a lot of jobs at the same time.
Browse files Browse the repository at this point in the history
  • Loading branch information
aronasorman committed May 23, 2017
1 parent 1c035ee commit b2967fe
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions tests/common/test_classes.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,13 +75,23 @@ def test_schedule_runs_function(self, inmem_client, flag):
# messaging backend.
try:
inmem_client._messaging.wait(mailbox=inmem_client.scheduler_mailbox_name, timeout=2)
inmem_client._messaging._wait_until_messages_processed()
except queue.Empty:
# Maybe it's been processed already... just continue anyway then.
pass

job = inmem_client.status(job_id)
assert job.state == Job.State.COMPLETED

def test_schedule_can_run_n_functions(self, inmem_client):
n = 10
events = [Event() for _ in range(n)]
for e in events:
inmem_client.schedule(set_flag, e)

for e in events:
assert e.wait(timeout=3)

def test_stringify_func_is_importable(self, client):
funcstring = client.stringify_func(set_flag)
func = client.import_stringified_func(funcstring)
Expand Down

0 comments on commit b2967fe

Please sign in to comment.