Skip to content

[SDK Sentinel] Stabilize AsyncPoller suspend polling test - #3011

Draft
sdk-sentinel-bot wants to merge 1 commit into
temporalio:mainfrom
sdk-sentinel-forks:automation/sdk-sentinel/ci-flake/java/31852541129-1-cb711db9384c
Draft

[SDK Sentinel] Stabilize AsyncPoller suspend polling test#3011
sdk-sentinel-bot wants to merge 1 commit into
temporalio:mainfrom
sdk-sentinel-forks:automation/sdk-sentinel/ci-flake/java/31852541129-1-cb711db9384c

Conversation

@sdk-sentinel-bot

Copy link
Copy Markdown

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

  • Flake confidence: high
  • Fix confidence: high
  • Value: medium
  • Patch scope: standard — 1 changed file; 1.8 KiB
  • Local reproduction: reproduced — The focused test reproduced expected 2 but was 1 before the patch under Java 23.
  • Regression coverage: fail-before-pass-after — The existing focused test failed before synchronization and passed three times afterward.
  • Unchanged baseline (Gradle formatting and test-source compilation) — passed
  • Independent candidate (Gradle 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

  • Continuous Integration / Unit test with CLI on Java 11
  • Canonical .ci-flake-runtime/input/validate.sh in the normal validation environment

Residual risks

  • The canonical candidate check did not execute because of sandbox cache ownership.
  • Local focused verification used Java 23 and excluded unrelated submodule and Java 17/21 compilation tasks.

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-08-13 19:47 UTC
  • Latest occurrence: 2026-08-13 19:47 UTC
  • Recent occurrences:

@CLAassistant

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

1 similar comment
@CLAassistant

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants