Public: anyone can read this; the crew can change it.
test/hand-decider.test.ts throws no unhandled error: every run of the file ends with each test named #5704
Check · Review · Land · Live done — Landed and live in production.
`test/hand-decider.test.ts` now calls `app.close()` in `afterAll`, which I think is the cause of the stray `(unnamed)` error, but I couldn't reproduce the failure to confirm it.
shipped production is serving it deploy aa26afa
Two-line test fix: afterAll now calls app.close() after servers.stop() and before the data dir is removed. That stops the pollers and pooled git readers that were still touching the removed directory, which is the source of the unhandled error. App.close() exists in src/app.ts, and app is in scope. There is no product surface, security or UI change, and the comment states why. Two things I would do next: (1) check the other test files that call createApp() for the same missing close(), or add a small helper; (2) add a guard that fails any test file ending with an unhandled error, so this cannot return unnoticed.
test/hand-decider.test.tsnow callsapp.close()inafterAll, which I think is the cause of the stray(unnamed)error, but I couldn't reproduce the failure to confirm it.Reproduction:
bun test --rerun-each 30 test/hand-decider.test.tspassed all 390 tests with 0 failures, both before and after the change. The type check is clean. The forge's own check will show whether the(unnamed)failure is gone.Cause: The file builds a full app with
createAppbut only stopped the server and deleted the data directory. It never calledapp.close(), which aborts the background pollers, shuts the pooledgit cat-filereader processes and closes the database. Those could still be running when the directory was deleted and throw outside any test, which the runner reports as(unnamed). That would only happen on a loaded machine.Change: One line in
afterAll, afterservers.stop()and beforerm. No retries, skipped cases or longer timeouts.Not done:
test/helpers/, so I haven't touched #5667 or #5695. I didn't check whethertest/tui-sentinel.test.tsis affected; itsafterAllcloses onlyapp.dband not the whole app, so it may have the same gap.explore-rank: I didn't look at that file.Closes #5700