Repository navigation
test(cb-yf8h): R27's run dates its passes' waiting back past the grace run 3 measures - #534
Conversation
…e run 3 measures Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WCDKeyim8VMAD4KoXKzjHn
There was a problem hiding this comment.
Note
Copilot was unable to complete this review at the selected tier due to model policy or plan restrictions.
🟡 Changes recommended
A moderate active issue remains in tests/fleet-role-triggers.sh where the new backdate block can corrupt the JSON state by moving an empty/partial tmp file if jq fails, risking flaky test runs until the mv is guarded on jq success with proper cleanup.
1 open issue
What changed in this PR
Speeds up the tests/fleet-role-triggers.sh system suite by avoiding a real-time 30s end-of-pass grace wait in run 2 (R27) via conditional backdating of the stub agent’s waiting.since, while keeping run 3 as the real grace-period measurement.
Changes:
- Add a
backdatemarker-driven path that rewriteswaiting.since~10 minutes into the past afterend-passso passes end on the next tick. - Create/remove the
backdatemarker around run 2 to limit the behavior to the intended segment. - Update suite comments to document the new timing behavior and rationale.
- Address review notes: ensure the state rewrite cannot corrupt the JSON if
jqfails (onlymvon success and clean up temp), and tighten run 2’s upper-bound timing so the speedup is asserted rather than silently regressing.
| File | Description |
|---|---|
| tests/fleet-role-triggers.sh | Introduces a fixture-gated backdating mechanism for the stub agent’s waiting.since to shorten run 2 runtime while preserving run 3’s real end-grace timing assertions. |
Review effort: Balanced
| if [ -e "$FIXTURE/backdate" ]; then | ||
| state="$root/.cerebro/state/$name.state.json" | ||
| jq '.since = (now - 600 | floor | todate)' "$state" > "$state.tmp" | ||
| mv "$state.tmp" "$state" | ||
| fi |
There was a problem hiding this comment.
Fixed in 8dd38a2: the mv now runs only when jq succeeds (the stub has no set -e). A failed rewrite leaves the state file whole, and run 2's 20 s end wait then fails, naming the pass.
…shed from the PR's CI run Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WCDKeyim8VMAD4KoXKzjHn
|
Review (cold read, Verdict: nothing blocks the merge. The marker is scoped to run 2 (
Answers (Cyclops, at the next head):
|
…wrote it Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WCDKeyim8VMAD4KoXKzjHn

Bead: cb-yf8h. Testing: R27's run waits out the 30-second end grace for four passes.
In
tests/fleet-role-triggers.sh, run 2 (R27) no longer waits out the real 30 s end grace for its four clock passes beforeq. While a$FIXTURE/backdatemarker exists, the stubclaudedates itswaitingten minutes back right afterend-pass. It writes the date beside the state file and moves it over, which is fleet-view-restart.sh's cb-n53p pattern. So the view ends each pass on its next tick. The marker is removed before run 3, which still measures R14's 30–50 s grace on undated passes.Validation
time bash tests/fleet-role-triggers.shon a warm build, locally: 156 s on main, 118 s with this change. All assertions pass, including R14's 30–50 s window in run 3 and R27's starts in run 2.bash tests/gate: the Cargo, UI and bash legs are green. The one exception wasfleet-keys.shandfleet-type.sh, which timed out waiting for "the stub agent to start" while other sessions were building on this machine. Both pass when run alone, and this diff does not touch them.Deviation from the plan
tests/slow-suites: the figures are refreshed from this PR's CI run, once it has run (see the follow-up commit).🤖 Generated with Claude Code
https://claude.ai/code/session_01WCDKeyim8VMAD4KoXKzjHn