Skip to content

Derive reset point from history in random seed test - #1840

Merged
tconley1428 merged 1 commit into
mainfrom
flake/random-seed-reset-point
Sep 10, 2026
Merged

Derive reset point from history in random seed test#1840
tconley1428 merged 1 commit into
mainfrom
flake/random-seed-reset-point

Conversation

@DABH

@DABH DABH commented Sep 10, 2026

Copy link
Copy Markdown
Contributor

What was changed

test_random_seed_functionality long-polls history for the workflow task that follows ActivityTaskCompleted and 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 reset event_id=9 is 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.

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.
@DABH DABH added the skip-changelog PR changes do not require changelog updates label Sep 10, 2026
@DABH
DABH requested a balanced review from Copilot September 10, 2026 07:34

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟢 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
DABH marked this pull request as ready for review September 10, 2026 07:52
@DABH
DABH requested a review from a team as a code owner September 10, 2026 07:52
@tconley1428
tconley1428 merged commit 8ec0d91 into main Sep 10, 2026
34 of 36 checks passed
@tconley1428
tconley1428 deleted the flake/random-seed-reset-point branch September 10, 2026 15:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

skip-changelog PR changes do not require changelog updates

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants