[SDK Sentinel] Stabilize sticky cache metric assertions - #3069
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 a test-only assertion after the Linux Java 23 Edge suite intermittently observed an active-thread gauge of zero. The test passed in the [last known good job](https://github.com/temporalio/sdk-java/actions/runs/34508568447/job/102976712372) and failed in the [first known bad job](https://github.com/temporalio/sdk-java/actions/runs/34634340353/job/103378476256). No public API, breaking, or server changes.
Root cause
The test slept for a fixed 600 ms before sampling asynchronously published gauges once. Runner scheduling could leave the reporter's latest value at zero when sampled.
Fix
Use the existing bounded eventual-assertion helper around both original active-state gauge expectations. This preserves the asserted values while removing dependence on one wall-clock sample.
Validation
Five patched focused stress attempts and formatting passed. Six unchanged attempts did not naturally reproduce the low-rate failure. The unchanged baseline validator passed, but candidate validation stopped at submodule setup because this investigation sandbox makes git submodule metadata read-only. The Linux Java 23 Edge job and canonical validator remain required.
Validation status:
validation-incompletehighmediummediumstandard— 1 changed file; 1.6 KiBnot-reproduced— The unchanged focused test passed six local attempts; the captured same-dimension CI pass/failure establishes the low-rate flake.pass-after-only— The existing focused test is the regression coverage and passed five post-change stress attempts.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 ./gradlew --offline --no-daemon --init-script .ci-flake-runtime/tmp/redirect-build.gradle :temporal-sdk:test --tests "io.temporal.workflow.MetricsTest.testStickyCacheSize" -x :temporal-serviceclient:initSubmodules -x :temporal-serviceclient:updateSubmodules -x :temporal-sdk:compileJava17Java -x :temporal-sdk:compileJava21Java— passed; 5 attempt(s). All five patched focused stress attempts passed; six unchanged attempts had also passed..ci-flake-runtime/input/validate.sh— failed; 1 attempt(s). Formatting checks reached the submodule tasks, then validation was blocked because the sandbox made .git/modules submodule configuration read-only. The trusted unchanged baseline had passed.GRADLE_USER_HOME=.ci-flake-runtime/tmp/gradle-agent ./gradlew --offline --no-daemon --init-script .ci-flake-runtime/tmp/redirect-build.gradle spotlessApply -x :temporal-serviceclient:initSubmodules -x :temporal-serviceclient:updateSubmodules— passed; 1 attempt(s). Repository formatting completed successfully.Required target CI
Residual risks
Automation provenance
dd28759b03134c0a9d43ffe960061d07f1759c3dIf 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-11 18:46 UTC2026-09-11 18:46 UTC