Skip to content

fix(java): deflake workerScopedResourceIsBuiltPerWorker#399

Merged
pratyush618 merged 1 commit into
masterfrom
fix/java-resource-test-flake
Jul 8, 2026
Merged

fix(java): deflake workerScopedResourceIsBuiltPerWorker#399
pratyush618 merged 1 commit into
masterfrom
fix/java-resource-test-flake

Conversation

@pratyush618

Copy link
Copy Markdown
Collaborator

Problem

ResourceTest.workerScopedResourceIsBuiltPerWorker timed out on the osx-aarch64 Java smoke leg (run).

Test used a CyclicBarrier(2): worker 1's bothBusy.await(20s) requires worker 2 to reach the barrier within 20s of the first arrival. Under heavy CI load (release native compile + 292 tests on a loaded runner) the two workers don't overlap in that window, the barrier times out and breaks, the job fails, and the ran latch never reaches 0.

Fix

Drop the rendezvous. Two concurrency(1) workers each hold their slot on a plain release latch while running a job, so a single worker cannot claim both jobs — its concurrency gate is full, leaving the second job for the other worker. The test polls resourceMetrics().created() until it reaches 2, then releases.

Distribution is still guaranteed by the concurrency gate (the real invariant under test); timing now gets the full 25s budget with no "must overlap" constraint.

Worker-scoped resources build lazily on first Resources.use (ResourceRuntime.resolveWorker) and counters aggregate to queue.resourceMetrics(), so polling the created-count is sound. Sibling test pooledInstancesDisposedAtWorkerShutdown (single worker, concurrency 2) is unaffected and left as-is.

Verification

  • workerScopedResourceIsBuiltPerWorker: 8/8 forced reruns pass locally
  • Full ResourceTest class green
  • spotlessJavaCheck + checkstyleTest clean

@coderabbitai

coderabbitai Bot commented Jul 8, 2026

Copy link
Copy Markdown

Warning

Review limit reached

You’ve reached a temporary PR review limit under our Fair Usage Limits Policy.

Your recent review volume is higher than typical usage, so adaptive limits are currently applied.

Next review available in: 16 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: ac9b3104-5dbc-4cad-98f8-b19be7133f66

📥 Commits

Reviewing files that changed from the base of the PR and between fa3aaf7 and 2ec22cb.

📒 Files selected for processing (1)
  • sdks/java/src/test/java/org/byteveda/taskito/resources/ResourceTest.java
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/java-resource-test-flake

Comment @coderabbitai help to get the list of available commands.

@pratyush618
pratyush618 merged commit 531b670 into master Jul 8, 2026
18 checks passed
@pratyush618
pratyush618 deleted the fix/java-resource-test-flake branch July 8, 2026 08:28
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