test(productivity-review): cap the full-window recovery test like its siblings (BLO-22985) - #1911
Conversation
… siblings (BLO-22985) The BLO-33477 full-window recovery test was authored without an explicit vitest cap, so it inherited the 60s global while its two sibling 250-cohort tests in the same file carry 120s. It inserts 500 rows and then drives 250 deterministically-failing finalizes, each with its own back-off UPDATE: measured 32.5s unloaded, i.e. 1.8x under the global. A merge-queue runner pod at 1.0-1.8 cores clears that margin easily and did, ejecting #1854 from the master queue on 2026-09-17 (run 35226379587). 120s is 3.7x the measured cost. It does not loosen the invariant: the failure this test detects is an unbounded recovery loop, which does not finish at any budget.
1 similar comment
|
@ally head Requested a review from @allyblockcast directly (native GitHub review request, not just this comment) against current head |
There was a problem hiding this comment.
Ally — Consolidated PR Review
Lenses: pr-review-toolkit (code, tests, comments, errors, types) + gstack/review + native-codex (CLI unavailable in this k8s runtime; prompts applied directly to the diff and the exact changed path).
Reviewed head: 25cb496
Looks good. One-file, test-only change: a per-test timeout on an existing test, plus the rationale for it. I verified every load-bearing claim in the new comment against the tree at this head rather than taking it on trust.
server/vitest.config.ts:36—testTimeout: 60_000confirmed, and that file's own comment already records that Vitest honours a per-test timeout over the global, so the override is the sanctioned mechanism here.server/src/__tests__/productivity-review-service.test.ts:3474,3548,7402— the three sibling full-window tests already carry a bare}, 120_000). This one at:6284was the outlier.server/src/__tests__/productivity-review-service.test.ts:6175-6178—failingCount = 250inserted as both decoy sources and decoy reviews, i.e. the 500 rows the comment cites, plus 250 throwing finalizes on pass 1. The count is not arbitrary padding: the test's whole shape is LIMIT saturation (:6151-6154), so trimming the workload instead of raising the cap would delete what the test asserts. Raising the timeout is the correct lever.it(name, fn, timeout)is the correct Vitest signature;vitestis the imported runner (:3).
Critical Issues (0)
Important Issues (0)
Suggestions (1)
- [comments]
server/src/__tests__/productivity-review-service.test.ts:6274-6283— the rationale rests the headroom argument on one unloaded measurement (32.5s) plus an inferred pod-core ratio, which is the weakest evidence available for it. The strongest evidence is already in the same file and goes unmentioned: three siblings with the same 250-row shape pass at 120s on these runners today. Worth one line if this block is ever revisited; not worth a push on its own.
Strengths
- Root cause, not symptom: the fix is the missing cap on the one test that lacked it, matching an established in-file convention rather than inventing a new mechanism.
- The comment pre-empts the obvious objection — that raising a timeout masks a hang — and answers it on the test's own semantics: an unbounded recovery loop terminates at no budget, so the assertion this test exists to make survives the larger cap.
- Concrete incident provenance (queue ejection, run id) is recorded where the next reader of the constant will find it.
- Test-only; no production code path is touched, so the blast radius is CI wall-clock.
Recommended Action
- No blocking changes requested.
- Merge once the remaining required CI checks finish green.
|
Thanks — taking the suggestion as correct but deliberately not pushing for it, for the reason you named yourself. On substance you're right, and it's slightly worse than you wrote. There are three siblings carrying a bare Why it isn't going in as a follow-up commit. A push moves the head, which:
This PR exists because that saturation ejected #1854 and #1740 from the merge queue today (BLO-22985 occurrences #6 and #7, ~1h of queue drain each at Recorded on BLO-22985 instead, so the next edit to this block picks it up: replace the "two siblings" line with the sibling-parity argument — Enqueueing at |
Thinking Path
Linked Issues or Issue Description
What Changed
server/src/__tests__/productivity-review-service.test.ts: added}, 120_000)torecovers a stale reservation behind a full window of failing ones (BLO-33477), matching the two sibling full-window tests at the same cohort size, plus an inline comment recording the measured cost, the margin, and why 120s still catches the regression.Verification
Ran the test in isolation against embedded Postgres:
✓ ... (BLO-33477) 32471ms, 1 passed. Ran the whole file: 184 tests, all green, this test 28932ms.Ranked every test in the file by measured duration. This one is 3.1x the next slowest (9335ms, already capped at 120s) and is the only test in the file with under 3x margin against its effective budget — so no other test here needs widening:
Host: 64 cores, load average ~10, embedded Postgres. A CI runner pod at 1.0–1.8 cores is the slower end of that.
Risks
reservedAt, stays ahead of the target forever, andtargetFinalizeAttemptsnever reaches 1). That does not finish at 60s, at 120s, or at any budget — it fails on the assertion, not the clock. 120s only buys room for the honest 29s cost.merge_groupafter this lands, the load-flake classification is wrong and it should be reopened as a real defect in the recovery path — not widened a second time.Model Used