fix(java): deflake workerScopedResourceIsBuiltPerWorker#399
Conversation
|
Warning Review limit reachedYou’ve reached a temporary PR review limit under our Fair Usage Limits Policy. Next review available in: 16 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the 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 configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
Problem
ResourceTest.workerScopedResourceIsBuiltPerWorkertimed out on the osx-aarch64 Java smoke leg (run).Test used a
CyclicBarrier(2): worker 1'sbothBusy.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 theranlatch never reaches 0.Fix
Drop the rendezvous. Two
concurrency(1)workers each hold their slot on a plainreleaselatch 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 pollsresourceMetrics().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 toqueue.resourceMetrics(), so polling the created-count is sound. Sibling testpooledInstancesDisposedAtWorkerShutdown(single worker, concurrency 2) is unaffected and left as-is.Verification
workerScopedResourceIsBuiltPerWorker: 8/8 forced reruns pass locallyResourceTestclass greenspotlessJavaCheck+checkstyleTestclean