[SDK Sentinel] Stabilize AsyncPoller suspend polling test - #3011
Draft
sdk-sentinel-bot wants to merge 1 commit into
Draft
Conversation
|
|
1 similar comment
|
|
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 draft 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 suspension test that intermittently observed one reservation instead of two in the [failing CLI build](https://github.com/temporalio/sdk-java/actions/runs/31736390256/job/94568941059). The [preceding main build](https://github.com/temporalio/sdk-java/actions/runs/31723454282) passed, while the [first observed failing main build](https://github.com/temporalio/sdk-java/actions/runs/31736390256) exposed the race. There are no breaking changes and no server update is required.
Root cause
The first poll latch only established that the initial poll began. The test could suspend the poller before its loop attempted the next slot reservation, so the asserted reservation count depended on thread scheduling.
Fix
Wait for the second reservation attempt before suspending. This preserves the existing assertions and production behavior while making their precondition deterministic.
Validation
The focused test reproduced the failure before the change and passed three times afterward. The unchanged baseline validation passed. Candidate validation was attempted but could not start because the sandbox-owned Gradle daemon cache rejected chmod; Java 11 CLI and canonical CI validation remain required.
Validation status:
validation-incompletehighhighmediumstandard— 1 changed file; 1.8 KiBreproduced— The focused test reproduced expected 2 but was 1 before the patch under Java 23.fail-before-pass-after— The existing focused test failed before synchronization and passed three times afterward.Gradle formatting and test-source compilation) — passedGradle formatting and test-source compilation) — did not pass (failure)Investigator-run checks
./gradlew --offline :temporal-sdk:test --tests 'io.temporal.internal.worker.AsyncPollerTest.testSuspendPolling' -x :temporal-serviceclient:initSubmodules -x :temporal-serviceclient:updateSubmodules -x :temporal-sdk:compileJava17Java -x :temporal-sdk:compileJava21Java— passed; 4 attempt(s). The unpatched test reproduced the exact assertion once; the patched test passed three consecutive executions..ci-flake-runtime/input/validate.sh— failed; 1 attempt(s). Validation could not start because Gradle could not chmod the preloaded daemon cache. The trusted unchanged-checkout baseline had succeeded.Required target CI
Residual risks
Automation provenance
7cf35351b27a3a7af17b4fadd4d281893a96580fIf 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-08-13 19:47 UTC2026-08-13 19:47 UTC