Skip to content

[SDK Sentinel] Fix cancellation-reason test time-skipping race - #1982

Merged
tconley1428 merged 1 commit into
temporalio:mainfrom
sdk-sentinel-forks:automation/sdk-sentinel/ci-flake/python/39081589380-1-df01dd1be03f
Oct 19, 2026
Merged

tconley1428 merged 1 commit into
temporalio:mainfrom
sdk-sentinel-forks:automation/sdk-sentinel/ci-flake/python/39081589380-1-df01dd1be03f

Conversation

@sdk-sentinel-bot

Copy link
Copy Markdown
Contributor

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-reproduction

  • Flake confidence: high
  • Fix confidence: high
  • Value: medium
  • Patch scope: standard — 1 changed file; 633 B
  • Local reproduction: not-reproduced — The unchanged focused test passed once on Linux under time-skipping V2; the captured macOS ARM failure was not reproduced locally.
  • Regression coverage: pass-after-only — The existing two-case cancellation-reason test passed five consecutive time-skipping V2 runs after the change.
  • Unchanged baseline (Poe lint, bridge lint, and editable build) — passed
  • Independent candidate (Poe lint, bridge lint, and editable build) — passed

Investigator-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

  • build-lint-test (3.14, macos-arm), including time-skipping-v2

Residual risks

  • The failure was observed on macOS ARM and did not reproduce on the Linux investigator.
  • The bounded snapshot has no same-SHA rerun proving fail-then-pass behavior.

Automation provenance

If this finding should not be fixed, apply the sdk-sentinel:false-positive label and close the PR. Sentinel will suppress the finding until its affected source changes.

SDK Sentinel recurrence history

  • Unique failed CI run attempts: 1
  • First occurrence: 2026-10-16 17:50 UTC
  • Latest occurrence: 2026-10-16 17:50 UTC
  • Recent occurrences:

@sdk-sentinel-bot
sdk-sentinel-bot requested a review from a team as a code owner October 18, 2026 00:39
@tconley1428 tconley1428 added the skip-changelog PR changes do not require changelog updates label Oct 19, 2026
@tconley1428
tconley1428 merged commit daa067d into temporalio:main Oct 19, 2026
46 of 49 checks passed
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.

2 participants