Skip to content

session: control the clocks in the slowest regression tests - #1733

Merged
AbirAbbas merged 2 commits into
devfrom
tests/session-slow-tests
Oct 2, 2026
Merged

AbirAbbas merged 2 commits into
devfrom
tests/session-slow-tests

Conversation

@AbirAbbas

Copy link
Copy Markdown
Collaborator

What

Twelve internal/session tests spent about 123 seconds (sum of local medians, ten runs each) waiting on real wall clocks: watch tickers, the team traffic settle, the steer grace, a blocked phase listener, and a stalled checker's call share. They are a large share of the session leg in every pull request's touched packages run, and a real-clock window is the same shape behind the suite's load-only failures (#1664, #1339).

Each test now drives the same real commands, queues, landings and receipts, and waits on an acknowledgement or an explicit clock advance instead of on time passing. Sum of medians after: about 4 seconds.

Test Before After
TestASlowListenerNeverHoldsTheTurnThatIsTellingIt 42.5s 0.5s
TestTeamWakeTheLoopBreakerCountsTenMemberReplies 20.9s 0.2s
TestWatchQuietFiresWhenTheOutputStopsMoving 12.7s 0.2s
TestWatchMatchDeliversOnlyMatchingLines 10.6s 0.2s
TestWatchTicksNeverStartATurn 8.7s 0.6s
TestAStalledCheckIsAbandonedAndTheSecondCallAnswers 7.3s 0.4s
TestASteerLandsWhenAYoungBashCrossesTheGrace 7.0s 0.4s
TestWatchStopsAfterThreeIdenticalFailures 6.9s 0.4s
TestWatchChangeIsBaselineSilenceThenDeltaOnly 4.6s 0.4s
three task-baseline tests 2.3s 0.9s

Product code

Four private seams, each nil/false in production and falling through to the exact call it replaces: jobRegistry.watchTickWait, Agent.steerAfter, Config.teamWatchManual, and Config.auditTimeout → callWindow.timeout. No default, window, limit or person-facing behaviour changes, so no manual page changes.

Validation

  • Before changing each test, the behaviour it pins was written down in one sentence.
  • Mutation proof per test: the smallest product edit that breaks that behaviour was applied through a Go overlay, and the changed test fails on it; the product file was then verified byte-identical.
  • -count=10 focused runs for every changed test; go vet, gofmt, make test-laws.
  • make pr-ready on this branch: light gate green; the full session suite failed three tests that this branch does not touch (TestARefutedNodesRepairRoundRunsOnTheCarefulModel and TestTickingAnItemMovesTheRowToTheNextItem: "task 1 never finished" on a fixed 30 s wait; TestSpendRowsFollowThePlanNode: 3 spend rows for 2 calls) while the box was at load ~40. All three pass 3/3 on this branch and 3/3 on plain dev once the load dropped, and no helper they use is changed here. They are pre-existing load-sensitive tests.

Not changed

The two plandb CLI tests that run a real loop through bash (about 35 s each) are left alone: they are integration tests, and a faster version would stop running the real CLI.

🤖 Generated with Claude Code

AbirAbbas and others added 2 commits October 1, 2026 18:32
Twelve internal/session tests spent about 123 seconds (sum of local
medians) waiting on real wall clocks: watch tickers, the team traffic
settle, the steer grace, a blocked phase listener and a stalled checker's
call share. They are a large share of the session leg in every pull
request's touched-packages run, and a real-clock window is also the shape
behind the suite's load-only failures (#1664, #1339).

Each now drives the same real commands, queues, landings and receipts,
and waits on an acknowledgement or an explicit clock advance instead of
time passing. The product gains four private seams (a watch tick wait, a
steer timer, a manual team traffic clock and a checker timeout), each nil
or false in production and falling through to the call it replaces, so
no default, window or person-facing behaviour changes. Every changed test
was proved against a product mutation of the behaviour it pins.

The sum of medians for the twelve is now about 4 seconds. The two plandb
CLI tests that run a real loop through bash (about 35 seconds each) are
left as they are: they are integration tests and a faster version would
have to stop running the real CLI.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@AbirAbbas
AbirAbbas merged commit 794b49a into dev Oct 2, 2026
4 checks passed
@AbirAbbas
AbirAbbas deleted the tests/session-slow-tests branch October 2, 2026 00:28
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.

1 participant