Derive reset point from history in random seed test - #1840
Merged
Conversation
test_random_seed_functionality polled a 'ready' query for up to 10s before resetting the workflow at hard-coded event 9. With the workflow cache disabled every poll replays the workflow in a fresh sandbox, and on a loaded CI runner the first workflow task alone took about 9s, so the poll timed out. Wait for the workflow task that follows the activity completion via a history long-poll instead, and reset to that task's started event. This removes the fixed 10s bound and the hard-coded event id, which would also be wrong whenever a workflow task is retried.
There was a problem hiding this comment.
🟢 Approval recommended
The focused test change correctly handles workflow-task retries without introducing unresolved issues.
Pull request overview
Updates the random-seed reset test to derive a retry-safe reset point from workflow history.
Changes:
- Removes the readiness query and polling.
- Selects the completed post-activity workflow task dynamically.
File summaries
| File | Description |
|---|---|
tests/worker/test_workflow.py |
Derives the reset event from history instead of using a hard-coded ID. |
Review details
- Files reviewed: 1/1 changed files
- Comments generated: 0
- Review effort level: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
DABH
marked this pull request as ready for review
September 10, 2026 07:52
tconley1428
approved these changes
Sep 10, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What was changed
test_random_seed_functionalitylong-polls history for the workflow task that followsActivityTaskCompletedand resets to that task's started event; the readiness query is removed.Why
Observed a CI flake with current behavior. The 10s readiness poll can expire (e.g, my most recent run took 9s on CI), and each poll replayed the workflow in a fresh sandbox (
max_cached_workflows=0), competing with the awaited task. The hard-coded resetevent_id=9is also invalid after any task retry.Testing
Emulated 9s and 11s stalls (the latter retries the first task): passes, deriving event 12. 240/240 under load. Lint clean.