Skip to content

Commit 1a1bd3e

Browse files
committed
avoiding timing issue
1 parent 059f0c2 commit 1a1bd3e

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

tests/test_flows.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -1534,9 +1534,10 @@ def timeout_noticing_task():
15341534

15351535
@flow(timeout_seconds=0.1)
15361536
def my_subflow():
1537-
time.sleep(0.5)
1537+
start = time.monotonic()
1538+
while time.monotonic() - start < 0.5:
1539+
pass
15381540
timeout_noticing_task()
1539-
time.sleep(10)
15401541
nonlocal completed
15411542
completed = True
15421543

0 commit comments

Comments
 (0)