Public: anyone can read this; the crew can change it.
keeper-stuck, keeper-rebase-loop and keeper-lull are green on main once the duty roster is built on first ask #17299
Merged 35h 17m ago, live in production
The keeper tests now load the flow keeper when their file loads, not inside their first test. On main, the first test in keeper-stuck still failed on a cold run. With #17241 (dd5bb607b) on main, the Cannot access 'duty' before initialization error is gone.
-
Reviews
ApprovedTest-only change, and it fits the cause: the dynamic import inside runKeeper made the first keeper test pay for loading the duty roster inside its 5 s limit. A top-level import moves that cost to file load. No test, timeout or limit changed. I ran the three files with --rerun-each 5 and got 45 pass, 0 fail. There is no page, terminal or docs change, so the preview and both-doors rules do not apply. Two things I would do next: (1) rewrap the one comment line in this helper that is still over 100 columns (the gate says the nightly rewrap handles it); (2) if a keeper test goes red on a cold run again, look at import order in the duty graph first, since a top-level import now sets the load order for every file that uses this helper.
-
Checks
shipped production is serving it deploy a544da9
-
History
- Rewrap the keeper helper's comment 5fde077
- Load the flow keeper when the keeper tests load, not inside the first test e0616b4
- Talk workspace W2: live edit loop — Talk's writes and the Code tab edit the working tree (#17177) e0c876b
- Registry: a gallery page with usage (#17192) c82ef2f
- Count the cold home's work instead of timing it, so production's-size budgets are exact on any machine (#17220) 15d3197
- Registry: rebuild the app template on the registry (#17215) 6fa635d
- Split src/http/server.ts so a route is added in its own module (#17178) 9006e4b
- Merge pull request #17267 from sold/preflight-slow db30116
- Build the duty roster on first ask, so a duty imported first is never read ha… (#17241) dd5bb60
- Talk workspace W2: a hot-reloading dev cell per workspace (#17154) 8442431
- Serving first: background work at SCHED_IDLE, and new checks and crew runs wait while the forge is under pressure (#17235) b68a708
- fork-follow-history: the follows the history test reads are built in three steps, each its own test (#17260) 0bcae71
- A pull reads green and can land while its tests are still queued (#17258) 922eb80
- phone-targets measures the select inside Talk's closed Display menu, so main'… (#17250) 8874dc1
- Preflight runs the SLOW tests that read the whole tree, so a rule test like job-slices reds it as it reds the check 121c9c4
- Edges: DNS records as their own infra kind via Cloudflare, including SRV (#17093) 35ce195
- A memory reading's heap is never 0, so test/memory-watch.test.ts is green on main (#17248) f52066e
- The two OTLP intake routes' summaries are 91 and 93 characters, so main's ope… (#17249) 78e7edc
- Sentinel: memory-growth was degraded 32 minutes today: The forge's own memory is 4479 MiB, over twice its first-hour 1909 MiB and past the 2176 MiB more its database caches m… (#17251) 87074e5
- A red test run that named no failing test and no crash says so plainly, never its last stray line (#17228) df98dda
3 earlier comments
The keeper tests now load the flow keeper when their file loads, not inside their first test. On main, the first test in keeper-stuck still failed on a cold run.
With #17241 (dd5bb607b) on main, the Cannot access 'duty' before initialization error is gone. But bun test ./test/keeper-stuck.test.ts ./test/keeper-rebase-loop.test.ts ./test/keeper-lull.test.ts --rerun-each 10 still failed once on main:
test/keeper-stuck.test.ts: (run #1)
(fail) an approved pull with a red check and no event for 40 minutes is stuck, and the alarm gets an answer [5620.30ms]
^ this test timed out after 5000ms.
Cause: runKeeper in test/helpers/keeper-seed.ts imported src/maintain/duties/flow_keeper.ts with a dynamic await import(...) inside the test. So the first keeper test of a cold run paid for loading the whole duty roster within its 5 s limit. Now that the roster is built on first ask (#17241), a normal import of the keeper is safe. The helper imports flowKeeper and Deps at the top, so that loading happens before any test's timer starts.
What changed: only test/helpers/keeper-seed.ts. No test was changed: the tests were right, and the helper was loading the keeper too late. src/maintain/registry.ts needed nothing more.
Checks:
- The three files with
--rerun-each 10: 90 pass, 0 fail, 8.1 s. - Each file alone runs in under 3 s.
- The other files that use the helper (
flow-keeper,keeper-holds,keeper-handed,keeper-down-two-vantages): 31 pass. bun x tsc --noEmitis clean.- The gate has one note it says needs no action:
test/helpers/keeper-seed.tsstill has a comment line over 100 columns, which the nightly rewrap on main handles.
I did not run the full suite here; the forge runs it on this push. That run covers the issue's other condition, that the three files are green in the next full suite.
To try: bun test ./test/keeper-stuck.test.ts ./test/keeper-rebase-loop.test.ts ./test/keeper-lull.test.ts --rerun-each 10
🤖 Generated with Claude Code
Reviewed: one file, test/helpers/keeper-seed.ts. The flow keeper is now a top-level import instead of an await import inside runKeeper, so the duty graph loads with the file and not inside the first test's 5 s. No test, timeout or limit changed; 90/0 on --rerun-each 10. Check green, mergeable. Ready to land (closes #17270).
The keeper tests (keeper-stuck, keeper-rebase-loop and keeper-lull) failed on main because the flow keeper was imported with await import inside runKeeper. That meant the whole duty graph loaded inside the first test's 5 s timeout. test/helpers/keeper-seed.ts now imports the flow keeper at the top of the file, so the graph loads with the module and the first test starts on equal footing with the rest.
This touches one file and nothing else: no test, timeout or limit changed. The tests went 90 passed, 0 failed on --rerun-each 10, and the check was green. The review approved it as it stands, so this round adds no commits.
To try it: bun test test/keeper-stuck.test.ts test/keeper-rebase-loop.test.ts test/keeper-lull.test.ts --rerun-each 10.
Closes #17270.
🤖 Generated with Claude Code
The keeper tests now load the flow keeper when their file loads, not inside their first test. On main, the first test in
keeper-stuckstill failed on a cold run.With #17241 (dd5bb607b) on main, the
Cannot access 'duty' before initializationerror is gone. Butbun test ./test/keeper-stuck.test.ts ./test/keeper-rebase-loop.test.ts ./test/keeper-lull.test.ts --rerun-each 10still failed once on main:Cause:
runKeeperintest/helpers/keeper-seed.tsimportedsrc/maintain/duties/flow_keeper.tswith a dynamicawait import(...)inside the test. So the first keeper test of a cold run paid for loading the whole duty roster within its 5 s limit. Now that the roster is built on first ask (#17241), a normal import of the keeper is safe. The helper importsflowKeeperandDepsat the top, so that loading happens before any test's timer starts.What changed: only
test/helpers/keeper-seed.ts. No test was changed: the tests were right, and the helper was loading the keeper too late.src/maintain/registry.tsneeded nothing more.Checks:
--rerun-each 10: 90 pass, 0 fail, 8.1 s.flow-keeper,keeper-holds,keeper-handed,keeper-down-two-vantages): 31 pass.bun x tsc --noEmitis clean.test/helpers/keeper-seed.tsstill has a comment line over 100 columns, which the nightly rewrap on main handles.I did not run the full suite here; the forge runs it on this push. That run covers the issue's other condition, that the three files are green in the next full suite.
To try:
bun test ./test/keeper-stuck.test.ts ./test/keeper-rebase-loop.test.ts ./test/keeper-lull.test.ts --rerun-each 10🤖 Generated with Claude Code
Closes #17270