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

opened this

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.

Notes

opened this

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 --noEmit is clean.
  • The gate has one note it says needs no action: test/helpers/keeper-seed.ts still 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

3 earlier comments
commented

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 --noEmit is clean.
  • The gate has one note it says needs no action: test/helpers/keeper-seed.ts still 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

commented

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).

commented

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

commented

Left #17270 open: 1 unticked item remain (If all three are green with no change, close this as done naming #17241's merge commit.).

Sign in to join this conversation.

Search
↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs