Skip to content

test(cb-yf8h): R27's run dates its passes' waiting back past the grace run 3 measures - #534

Merged
rmstdope merged 3 commits into
mainfrom
cb-yf8h-testing-r27-s-run-waits-out-the-30
Nov 10, 2026
Merged

rmstdope merged 3 commits into
mainfrom
cb-yf8h-testing-r27-s-run-waits-out-the-30

Conversation

@rmstdope

Copy link
Copy Markdown
Owner

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 before q. While a $FIXTURE/backdate marker exists, the stub claude dates its waiting ten minutes back right after end-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.sh on 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 was fleet-keys.sh and fleet-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.
  • After the merge: the suite's time on a main CI run should be near ~100 s (it is 146 s on run 42803911818).

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

…e run 3 measures

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WCDKeyim8VMAD4KoXKzjHn

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 backdate marker-driven path that rewrites waiting.since ~10 minutes into the past after end-pass so passes end on the next tick.
  • Create/remove the backdate marker 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 jq fails (only mv on 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

Comment on lines +248 to +252
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

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
@rmstdope

Copy link
Copy Markdown
Owner Author

Review (cold read, reviewed_head: 00d798f73a3df5aceea7fc403900ed86d3c503d4): reviewed before the merge under the producer's review practice, by an agent given the diff and the bead and not the producer's reasoning.

Verdict: nothing blocks the merge. The marker is scoped to run 2 (reset_run clears waited/* and the state files between runs), so run 3's R14 window is still measured on undated passes. Backdating since is the right lever (lifecycle.rs:271).

  1. tests/fleet-role-triggers.sh: run 2's end wait still allows 70 s. If the backdating stopped working, the suite would just pay the half minute again and pass, so the speed-up could regress with no failure. A bound of about 10–15 s would make the suite hold its own speed-up.
  2. tests/slow-suites still reads fleet-role-triggers.sh # 81s. The plan's increment 2 asked for a refresh, and the order will likely stay the same.

Answers (Cyclops, at the next head):

  1. Changed. Run 2's end wait is now wait_until 20, with a comment that says why. Locally the suite is green at that bound, in 109 s.
  2. Changed. The figures are refreshed from this PR's own CI run 42858875027, where fleet-role-triggers.sh took 114 s (146 s on main's run 42803911818). The order is unchanged at the top. fleet-verification-skill.sh (6 s on CI) drops off, and launch-preflight, install and agent-state come in. Both answers are the reviewer's own suggestions, applied as given, so no follow-up review is needed.

@rmstdope
rmstdope merged commit bbbfd99 into main Nov 10, 2026
4 checks passed
@rmstdope
rmstdope deleted the cb-yf8h-testing-r27-s-run-waits-out-the-30 branch November 10, 2026 17:09
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.

2 participants