[SDK Sentinel] Fix race in AsyncPoller suspend test - #3105
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 branch has not been deployed
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
Stabilize the AsyncPoller suspend test after the [first captured failing execution](https://github.com/temporalio/sdk-java/actions/runs/36594382094/job/109495407337). The [last captured pass before that failure](https://github.com/temporalio/sdk-java/actions/runs/36578377393/job/109439798275) exercised the same unit test. There are no public API, breaking, or server changes.
Root cause
The test could suspend polling before the second poll-loop iteration called
reserveSlot. That iteration then remained behind the suspend latch, so the assertion observed one reservation instead of two. A later test-classification change had removed the existing wait for the retained reservation counter.Fix
Wait until the second
reserveSlotcall begins before suspending polling. This establishes the intended ordering without sleeps, retries, production changes, or weaker assertions.Validation
The focused JDK 23 test passed six times, and the full test class passed once. The unchanged baseline validator passed. Candidate validation could not start in the investigation sandbox because Gradle could not change permissions on its preloaded daemon cache. Normal CI must run the fixed validator and Cloud unit-test job; the race did not reproduce locally before the change.
Validation status:
validation-incompletehighhighmediumstandard— 1 changed file; 1.9 KiBnot-reproduced— One unpatched focused execution passed; the bounded CI job provides the natural reproduction.pass-after-only— The existing regression test passed six focused repetitions and once within its full class after restoring the ordering barrier.Gradle formatting and test-source compilation) — passedGradle formatting and test-source compilation) — did not pass (failure)Investigator-run checks
GRADLE_USER_HOME=.ci-flake-runtime/tmp/gradle-home ./gradlew --offline --no-daemon :temporal-sdk:cleanTest :temporal-sdk:test --tests 'io.temporal.internal.worker.AsyncPollerTest.testSuspendPolling' -x :temporal-serviceclient:initSubmodules -x :temporal-serviceclient:updateSubmodules -x :temporal-sdk:compileJava17Java— passed; 6 attempt(s). All six patched JDK 23 executions passed.GRADLE_USER_HOME=.ci-flake-runtime/tmp/gradle-home ./gradlew --offline --no-daemon :temporal-sdk:cleanTest :temporal-sdk:test --tests 'io.temporal.internal.worker.AsyncPollerTest' -x :temporal-serviceclient:initSubmodules -x :temporal-serviceclient:updateSubmodules -x :temporal-sdk:compileJava17Java— passed; 1 attempt(s). The complete AsyncPollerTest class passed.GRADLE_USER_HOME=.ci-flake-runtime/tmp/gradle-home ./gradlew --offline --no-daemon spotlessApply -x :temporal-serviceclient:initSubmodules -x :temporal-serviceclient:updateSubmodules— passed; 1 attempt(s). Repository formatting completed successfully; git diff --check also passed..ci-flake-runtime/input/validate.sh (trusted unchanged baseline)— passed; 1 attempt(s). The trusted unchanged baseline completed successfully..ci-flake-runtime/input/validate.sh (candidate)— failed; 1 attempt(s). Gradle could not start because the sandbox forbids chmod on the preloaded daemon registry; no repository task executed.Required target CI
Residual risks
Automation provenance
4a4e6b2d099511a2b471fd97a6fb9e6befc8e85dIf 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-09-29 16:12 UTC2026-09-29 16:12 UTC