Skip to content

Commit

Permalink
deflake test_retry_policy (#6644)
Browse files Browse the repository at this point in the history
This would fail sporaically when the file existed but the write had not yet been flushed to disk.

## Test Plan

pytest python_modules/dagster/dagster_tests/execution_tests/test_interrupt.py::test_retry_policy --count 100
  • Loading branch information
alangenfeld committed Feb 24, 2022
1 parent e574200 commit 50eda7a
Showing 1 changed file with 9 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -332,11 +332,16 @@ def test_retry_policy():
"""

def _send_int(path):
while not os.path.exists(path):
time.sleep(0.05)
pid = None
while True:
if os.path.exists(path):
with open(path) as f:
pid_str = f.read()
if pid_str:
pid = int(pid_str)
break

with open(path) as f:
pid = int(f.read())
time.sleep(0.05)

os.kill(pid, signal.SIGINT)

Expand Down

0 comments on commit 50eda7a

Please sign in to comment.