Skip to content

[SDK Sentinel] Stabilize sticky cache metrics test - #3037

Open
sdk-sentinel-bot wants to merge 1 commit into
temporalio:mainfrom
sdk-sentinel-forks:automation/sdk-sentinel/ci-flake/java/32792182767-1-c06ed9adb133
Open

[SDK Sentinel] Stabilize sticky cache metrics test#3037
sdk-sentinel-bot wants to merge 1 commit into
temporalio:mainfrom
sdk-sentinel-forks:automation/sdk-sentinel/ci-flake/java/32792182767-1-c06ed9adb133

Conversation

@sdk-sentinel-bot

Copy link
Copy Markdown
Contributor

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.testStickyCacheSize after 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-incomplete

  • Flake confidence: high
  • Fix confidence: high
  • Value: medium
  • Patch scope: standard — 1 changed file; 2.2 KiB
  • Local reproduction: not-reproduced — The unchanged focused test passed once on local JDK 23; the CI history directly captured the workflow timer firing before the failed assertion.
  • Regression coverage: pass-after-only — The existing focused test passed six post-change attempts after conversion to explicit signal synchronization.
  • Unchanged baseline (Gradle formatting and test-source compilation) — passed
  • Independent candidate (Gradle 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

  • Continuous Integration / Unit test with in-memory test service [Edge] on Java 23 with edge dependencies
  • Canonical repository validation: spotlessCheck testClasses -x test

Residual risks

  • The exact Edge dependency set was not exercised locally.
  • Independent candidate repository validation was blocked by sandbox cache ownership, although the unchanged baseline passed.

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-24 22:33 UTC
  • Latest occurrence: 2026-08-24 22:33 UTC
  • Recent occurrences:

@sdk-sentinel-bot
sdk-sentinel-bot requested a review from a team as a code owner August 25, 2026 00:41
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.

1 participant