Skip to content

Commit 6dd59dd

Browse files
authored
Fix flaky test: test_workflow_patch_memoized (#1114)
* Run the test a lot * Format * More logs * Wait for post patch to also reach waiting signal * Remove debugging * Try a simpler method of signals waiting for run completion * Revert "Try a simpler method of signals waiting for run completion" This reverts commit 15137bf.
1 parent 3fe7e42 commit 6dd59dd

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

tests/worker/test_workflow.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2946,12 +2946,21 @@ async def waiting_signal() -> bool:
29462946
task_queue=task_queue,
29472947
)
29482948

2949+
# Need to wait until it has gotten halfway through, otherwise the post_patch workflow may never complete
2950+
async def waiting_signal() -> bool:
2951+
return await post_patch_handle.query(
2952+
PatchMemoizedWorkflowPatched.waiting_signal
2953+
)
2954+
2955+
await assert_eq_eventually(True, waiting_signal)
2956+
29492957
# Send signal to both and check results
29502958
await pre_patch_handle.signal(PatchMemoizedWorkflowUnpatched.signal)
29512959
await post_patch_handle.signal(PatchMemoizedWorkflowPatched.signal)
29522960

29532961
# Confirm expected values
29542962
assert ["some-value"] == await pre_patch_handle.result()
2963+
29552964
assert [
29562965
"pre-patch",
29572966
"some-value",

0 commit comments

Comments
 (0)