Fix two flaky tests: Jev prefetch timeout reporting and ACP gateway port collisions #276
All Vouch review confidence checks passed
Residual risk 0.24 = Change Risk (0.46) × (1 − Review Confidence (0.47)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.46 · 457 lines diff across 5 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.02 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.367
Shallow Review Depth
shallow_review_depth
0.344
Real PR Conversation Timeline
1 comments
"Review active on #276"
general
weight: 0.35
github-actions[bot]
Summary
Two tests failed intermittently under full-suite load and passed when run alone. Both causes are fixed; one was also a real telemetry bug.
Jev prefetch: a deadline hit during collection was reported as
no-candidatesbuildJevPrefetchgives candidate collection and the provider call one shared deadline. Source reads swallow aborts, so when the deadline lapsed mid-collection the pool came back empty and the run was logged asno-candidatesinstead oftimeout. The fail-open test's 50 ms budget could expire during collection under load, so it flaked.src/shared/jev-prefetch.ts: check the deadline before concluding the pool is empty. Both orderings now reporttimeout.test/jev-prefetch.test.ts: a zero-budget case pins the collection-time path deterministically. It failed 3/3 before the fix and passes 5/5 after.ACP remote test: a taken port became a silent 15 s timeout
The test started the gateway on a random port and waited 15 s for its
listeningline. The gateway starts in about 0.1 s, but exits onEADDRINUSE, and the test neither noticed the exit nor kept its stderr.test/acp-remote.test.ts: startup retries on a fresh port when the gateway exits before listening (up to 3 attempts), kills it on timeout, and includes its stderr in any failure. With the first port deliberately occupied, the test now passes in about 0.7 s instead of timing out.Review-quality gate
Neither file is a trigger path, and model inputs are unchanged; no benchmark run.
Validation
npm run lint,npm run typecheck(only the pre-existing@cline/sdkresolution errors),npm test(1163 pass, 0 fail),npm run build.<!-- This is an auto-generated description by cubic. -->
---
Summary by cubic
Fixes two flaky tests and a real telemetry bug behind one of them: Jev prefetch deadline hits during candidate collection were logged as
no-candidatesinstead oftimeout, and the ACP remote test silently timed out when its randomly chosen port was taken.timeout; a zero-budget test case pins the collection-time path and asserts no provider call was made.<sup>Written for commit 1ae0e8bcaa9007f72ee9c3fea445b8abfb6307cb. Summary will update on new commits.</sup>
<a href="https://cubic.dev/pr/pgup-ai/jbot-review/pull/276?utm_source=github" target="_blank" rel="noopener noreferrer" data-no-image-dialog="true"><picture><source media="(prefers-color-scheme: dark)" srcset="https://www.cubic.dev/buttons/review-in-cubic-dark.svg"><source media="(prefers-color-scheme: light)" srcset="https://www.cubic.dev/buttons/review-in-cubic-light.svg"><img alt="Review in cubic" src="https://www.cubic.dev/buttons/review-in-cubic-dark.svg"></picture></a>
<!-- End of auto-generated description by cubic. -->
<!-- This is an auto-generated comment: release notes by coderabbit.ai -->
Summary by CodeRabbit
Bug Fixes
Improved timeout handling during context preparation. When a request’s deadline expires while candidates are being collected, it now returns the baseline context and is reported as a timeout instead of appearing to have no candidates. This makes timeout outcomes more accurate and consistent.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->