Repository navigation
[SDK Sentinel] Fix cancellation-reason test time-skipping race - #1982
Merged
Conversation
tconley1428
approved these changes
Oct 19, 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.
Caution
This PR contains untrusted AI-generated code. Do not approve or run CI until a maintainer has reviewed the diff. SDK Sentinel verified that GitHub Actions remained approval-gated with zero executable jobs when this PR was opened.
Summary
A macOS ARM Python 3.14 time-skipping V2 job failed while querying the cancellation-reason workflow. The [preceding main run](https://github.com/temporalio/sdk-python/actions/runs/38939898149) passed the equivalent job, while the [first observed failure](https://github.com/temporalio/sdk-python/actions/runs/38940312509/job/117105967325) timed out after the workflow reached its intentional unreachable failure.
Root cause
The workflow waited on a finite 1,000-second timer while expecting an external cancellation. Time-skipping V2 could advance that timer before the client sent cancellation, making the workflow fail repeatedly and preventing its query from completing.
Fix
Wait on a condition that cannot become true instead. It remains interruptible by workflow cancellation but gives time-skipping no timer to advance.
Validation
Both parameter cases passed five consecutive focused time-skipping V2 runs. The fixed repository validator passed. The unchanged test did not reproduce locally, so the macOS ARM Python 3.14 job remains required.
Validation status:
validated-without-reproductionhighhighmediumstandard— 1 changed file; 633 Bnot-reproduced— The unchanged focused test passed once on Linux under time-skipping V2; the captured macOS ARM failure was not reproduced locally.pass-after-only— The existing two-case cancellation-reason test passed five consecutive time-skipping V2 runs after the change.Poe lint, bridge lint, and editable build) — passedPoe lint, bridge lint, and editable build) — passedInvestigator-run checks
poe test -s --workflow-environment time-skipping-v2 -k test_workflow_cancellation_reason— passed; 1 attempt(s). The unchanged checkout passed both parameter cases once on Linux, so the CI flake was not naturally reproduced.poe test -s --workflow-environment time-skipping-v2 -k test_workflow_cancellation_reason— passed; 5 attempt(s). Both parameter cases passed in five consecutive post-change runs..ci-flake-runtime/input/validate.sh— passed; 1 attempt(s). Import sorting, formatting, pyright, mypy, basedpyright, docstyle, Rust clippy, and editable bridge build all passed.Required target CI
Residual risks
Automation provenance
da794611dbfc746ca27c65385d00d9089de5c57bIf this finding should not be fixed, apply the
sdk-sentinel:false-positivelabel and close the PR. Sentinel will suppress the finding until its affected source changes.SDK Sentinel recurrence history
2026-10-16 17:50 UTC2026-10-16 17:50 UTC