Skip to content

Commit

Permalink
Update test output polling logic
Browse files Browse the repository at this point in the history
  • Loading branch information
aganders3 committed May 24, 2023
1 parent fb1c670 commit 15936d3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tests/test_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ def _poll_for_file_contents(path, timeout=10):
sleep(1)
if time() >= t0 + timeout / 2:
raise RuntimeError(f"Timeout. File '{path}' was not created!")

out = ""
while not out:
out = Path(path).read_text()
while not (out := Path(path).read_text()):
sleep(1)
if time() >= t0 + timeout:
raise RuntimeError(f"Timeout. File '{path}' was empty!")
Expand Down

0 comments on commit 15936d3

Please sign in to comment.