[SDK Sentinel] Stabilize sticky cache metrics test - #3037
Open
sdk-sentinel-bot wants to merge 1 commit into
Open
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
Stabilize
MetricsTest.testStickyCacheSizeafter a [captured main-branch Edge failure](https://github.com/temporalio/sdk-java/actions/runs/32784548910/job/97613615698). No equivalent target-branch last-known-good run was captured; the [first captured bad run](https://github.com/temporalio/sdk-java/actions/runs/32784548910) was on an unrelated workflow-only commit.Root cause
The test used a five-second workflow timer to keep the workflow active. Under suite load, that timer fired before the active-thread assertion, so the valid gauge value had already returned to zero.
Fix
Keep the workflow blocked on an explicit signal and send that signal only after checking the active metrics. This removes elapsed-time ordering from the test. The change is test-only, has no breaking changes, and requires no server PR.
Validation
The focused JDK 23 test passed six post-change attempts, and the module formatting check passed. Exact Edge validation and the canonical repository check remain required because the isolated offline cache lacked an Edge dependency and its Gradle daemon directory was not writable.
Validation status:
validation-incompletehighhighmediumstandard— 1 changed file; 2.2 KiBnot-reproduced— The unchanged focused test passed once on local JDK 23; the CI history directly captured the workflow timer firing before the failed assertion.pass-after-only— The existing focused test passed six post-change attempts after conversion to explicit signal synchronization.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-agent.4PlliT ./gradlew --offline --no-daemon :temporal-sdk:test --tests 'io.temporal.workflow.MetricsTest.testStickyCacheSize' -x :temporal-serviceclient:initSubmodules -x :temporal-serviceclient:updateSubmodules -x :temporal-sdk:compileJava17Java— passed; 1 attempt(s). The post-change focused test passed on JDK 23.Repeat cleanTest and testStickyCacheSize with the local JDK 23 focused-test command— passed; 5 attempt(s). All five additional post-change stress attempts passed../gradlew --offline --no-daemon :temporal-sdk:test --tests 'io.temporal.workflow.MetricsTest.testStickyCacheSize' -PedgeDepsTest -PtestJavaVersion=23— failed; 1 attempt(s). The test did not start because the offline cache lacked slf4j-api 2.0.16.GRADLE_USER_HOME=.ci-flake-runtime/tmp/gradle-agent.4PlliT ./gradlew --offline --no-daemon :temporal-sdk:spotlessCheck -x :temporal-serviceclient:initSubmodules -x :temporal-serviceclient:updateSubmodules— passed; 1 attempt(s). The affected module's formatting check passed..ci-flake-runtime/input/validate.sh— failed; 1 attempt(s). The candidate validator could not start Gradle because Gradle could not chmod the preloaded daemon cache directory. The trusted unchanged baseline ran the same validator successfully.Required target CI
Residual risks
Automation provenance
12c21142e62b97e3efdbb9d5b58c1b8048bb3855If 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-24 22:33 UTC2026-08-24 22:33 UTC