Skip to content

Commit

Permalink
Prevent test timeout on a single CPU (#108)
Browse files Browse the repository at this point in the history
  • Loading branch information
crusaderky authored Oct 2, 2023
1 parent 910c63e commit b142286
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion zict/tests/utils_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,9 @@ def check_different_keys_threadsafe(

def worker(idx, key, value):
barrier.wait()
while any(c < 10 for c in counters):
# When running on a single CPU (`taskset -c 0 pytest`), multitasking can
# misbehave and almost completely starve one of the two threads
while any(c < 10 for c in counters) and all(c < 1000 for c in counters):
z[key] = value
try:
assert z[key] == value
Expand Down

0 comments on commit b142286

Please sign in to comment.