Skip to content

Commit

Permalink
test(supervisors): improve test_multiprocess reliability
Browse files Browse the repository at this point in the history
  • Loading branch information
vvanglro committed Dec 16, 2024
1 parent 0b1b372 commit bd08e0e
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions tests/supervisors/test_multiprocess.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,15 +90,17 @@ def test_multiprocess_health_check() -> None:
process.join()
try:
assert not process.is_alive(0.5)
while retry := 3:
time.sleep(0.5)
start_time = time.time()
while time.time() - start_time < 6:
try:
for p in supervisor.processes:
assert p.is_alive()
except AssertionError:
retry -= 1
time.sleep(0.5)
else:
break
except AssertionError:
time.sleep(1)
else:
raise RuntimeError()
finally:
supervisor.signal_queue.append(signal.SIGINT)
supervisor.join_all()
Expand Down

0 comments on commit bd08e0e

Please sign in to comment.