Repository navigation
[SDK Sentinel] Stabilize local activity shutdown test - #2766
Open
sdk-sentinel-bot wants to merge 1 commit into
Open
sdk-sentinel-bot wants to merge 1 commit into
sdk-sentinel-bot wants to merge 1 commit into
Conversation
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
The local-activity shutdown integration test intermittently stopped its worker before any workflow task started. This appeared in both [macOS embedded-server CI](https://github.com/temporalio/sdk-go/actions/runs/37868249424/job/113620043209) and [Linux cloud CI](https://github.com/temporalio/sdk-go/actions/runs/37959626170/job/113918841431). A [preceding main run](https://github.com/temporalio/sdk-go/actions/runs/37847881040) was successful before the [earliest captured failure](https://github.com/temporalio/sdk-go/actions/runs/37868249424).
Root cause
ExecuteWorkflow returns before the server schedules work and the worker begins the local activity. The test waited a fixed 100 ms before stopping the worker, so slower scheduling could produce zero started workflow tasks and test setup no longer exercised the intended shutdown behavior.
Fix
Signal when the first local activity starts and wait for that signal before stopping the worker. This establishes the required ordering without weakening the history assertions.
Validation
The focused test passed six times with default caching and once with WORKFLOW_CACHE_SIZE=0. One pre-change attempt passed without reproducing the flake. The fixed repository validator repeated the unchanged baseline's unrelated doclink collision, so macOS, cloud, and check CI remain required.
Validation status:
validation-incompletehighhighhighstandard— 1 changed file; 1.2 KiBnot-reproduced— The unmodified focused integration test passed once; CI supplied two identical failures across Linux/cloud and macOS/embedded-server modes.pass-after-only— The existing focused integration test passed six times after synchronization and once with workflow caching disabled.go run . check) — did not pass (failure)go run . check) — did not pass (failure)Investigator-run checks
cd internal/cmd/build && go run . integration-test -dev-server -run "TestIntegrationSuite/TestLocalActivityWorkerShutdownNoHeartbeat"— passed; 7 attempt(s). One pre-change attempt passed without reproduction; six post-change attempts passed.cd internal/cmd/build && WORKFLOW_CACHE_SIZE=0 go run . integration-test -dev-server -run "TestIntegrationSuite/TestLocalActivityWorkerShutdownNoHeartbeat"— passed; 1 attempt(s). The post-change focused test passed with workflow caching disabled..ci-flake-runtime/input/validate.sh— failed; 1 attempt(s). Failed at the same pre-existing doclink collision as the trusted unchanged baseline: package gax contains duplicate Version keys.git diff --check— passed; 1 attempt(s). The candidate diff has no whitespace errors.Required target CI
Residual risks
Automation provenance
733b222690ef005e9cb09e684a11372fe7241a68If 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-09 01:21 UTC2026-10-09 16:47 UTC