Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions tests/worker/test_workflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -2946,12 +2946,21 @@ async def waiting_signal() -> bool:
task_queue=task_queue,
)

# Need to wait until it has gotten halfway through, otherwise the post_patch workflow may never complete
async def waiting_signal() -> bool:
return await post_patch_handle.query(
PatchMemoizedWorkflowPatched.waiting_signal
)

await assert_eq_eventually(True, waiting_signal)
Copy link
Contributor

@dandavison dandavison Sep 24, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be beyond the call of duty, but it looks to me like this test was written before update existed and that a better way to implement this nowadays would be

    @workflow.update
    async def wait_until_waiting_signal_is_true(self) -> None:
        await workflow.wait_condition(lambda: self._waiting_signal)

...

        # Need to wait until it has gotten halfway through
        await pre_patch_handle.execute_update(
            PatchMemoizedWorkflowUnpatched.wait_until_waiting_signal_is_true
        )

[Tested and that seems to work]

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fair, but I'll leave it as long as it is working.


# Send signal to both and check results
await pre_patch_handle.signal(PatchMemoizedWorkflowUnpatched.signal)
await post_patch_handle.signal(PatchMemoizedWorkflowPatched.signal)

# Confirm expected values
assert ["some-value"] == await pre_patch_handle.result()

assert [
"pre-patch",
"some-value",
Expand Down
Loading