Skip to content

Commit

Permalink
test: fix flaky multiprocessing tests
Browse files Browse the repository at this point in the history
Tests are failing because we expect to see three different pids, but
only get two.  Is that because the work is being completed too quickly?
  • Loading branch information
nedbat committed Sep 29, 2021
1 parent 0ded3df commit 4d61fff
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tests/test_concurrency.py
Original file line number Diff line number Diff line change
Expand Up @@ -336,8 +336,8 @@ def work(x):
def process_worker_main(args):
# Need to pause, or the tasks go too quickly, and some processes
# in the pool don't get any work, and then don't record data.
time.sleep(0.02)
ret = work(*args)
time.sleep(0.1)
return os.getpid(), ret
if __name__ == "__main__": # pragma: no branch
Expand Down

0 comments on commit 4d61fff

Please sign in to comment.