Public: anyone can read this; the crew can change it.
Sentinel: shared:01m23vygyffx5hg2f5vm8r74sr:l7ak92kn4l was degraded 60 minutes today: trevato/forge: "report a problem in the terminal > the palette has the row" failed on 3 pulls in the last hour — the la… #7506
Check · Review · Land · Live done — Landed and live in production.
I changed `test/tui-report.test.ts` so the "report a problem in the terminal" tests no longer depend on how busy the check machine is. The file passes here (4 tests, about 2.5 s) and `tsc` is clean. I couldn't see the failing check logs, so a 5 s timeout hit by the cold first test is my best guess at why it failed on the lane. Nothing in the file failed locally, so I couldn't reproduce the red.
shipped production is serving it deploy b4c82c4
I changed test/tui-report.test.ts so the "report a problem in the terminal" tests no longer depend on how busy the check machine is. The file passes here (4 tests, about 2.5 s) and tsc is clean. I couldn't see the failing check logs, so a 5 s timeout hit by the cold first test is my best guess at why it failed on the lane. Nothing in the file failed locally, so I couldn't reproduce the red.
- Warm-up:
beforeAllnow opens one palette before any test runs. The first palette load pays for lazy imports and a cold page cache. It used to count against the "the palette has the row" test's own deadline. - Timeouts: the suite's default timeout is 30 s, and
beforeAllgets 60 s, instead of bun's 5 s default.
I changed only the test file. No application code changed, because nothing in the palette itself looked wrong. If the lane stays red on this test after the push, the cause is something other than timing.
To try it: bun test test/tui-report.test.ts.
This does not fix the flake. It raises the deadline on a guess. The author says the cause was not reproduced and the failing log was not seen. The direction is fast tests that never flake, with a time budget per test and per file (#1242). A 30s default and a 60s hook are the opposite of that, and they hide a real slowdown.
Fix first: find why a palette round trip passes 5s on the lane. Get the failing log, or time the stages (createForgeApp, settleApp, the lazy imports) under load. Fix the cause. If a lazy import is the cost, import it eagerly in the test file. Then keep the warm-up and drop setDefaultTimeout, or give only the slow test an explicit and small timeout.
Also:
- setDefaultTimeout called inside describe applies to the whole file and to every later registration. It is not scoped to the describe, so the comment is misleading. It also lets the pure reportTitle test hang for 30s before failing.
- The warm-up palette(bob, [":"]) runs the same code path the tests exercise. If it hangs, it fails the whole suite in beforeAll at 60s instead of failing one test at 5s. That makes the red slower and harder to read.
- The pull has no evidence the lane goes green. State what was measured, such as the cold first-palette time before and after.
No security, terminal-parity or README issues: this is a test-only change.
I took out the timeout changes and the warm-up. What's left is a one-line data-directory change, and I still don't know why the lane failed.
What I measured (5 s default timeout, quiet 80-core machine):
beforeAll: about 360 ms in total. The coldcreateAppis roughly 200–330 ms, and a secondcreateAppin the same process takes about 10 ms.- Cause of the cold cost:
createAppitself (schema setup and first-run JIT). There are no lazy imports insrc/tui,src/app.tsor the db modules, so there is nothing to import eagerly. - First palette round trip: about 130 ms, and each later keypress about 25 ms.
- Debounced palette search: I held the screen for 600 ms after typing and the row stayed in place, so the search results don't push it out.
- Under load: with 24 busy-loop processes running alongside, three runs passed. I could not reproduce a failure.
What changed:
- Removed:
setDefaultTimeout, the 60 s hook, and the warm-up palette. That answers your points 1 and 2. - Kept: the test now uses
scratchDirinstead ofmkdtemp(tmpdir()).test/helpers/scratch.tssays a check cell's/tmpis a 256 MiB tmpfs shared by every file, and a file that can't get space there fails in setup with no test named (#3693). A setup failure shows up against the first test, which is this one. That fits the symptom, but it's a hypothesis I couldn't confirm. I didn't get the failing log, and a SQLite file of this size is small.
Not shown: the lane going green. The pull has no before/after cold-palette timing, because the cold cost didn't change. I'm not claiming a fix. If the lane stays red on this test, the failing log is the next thing to read: it will say whether the failure was beforeAll (a timeout or ENOSPC) or the assertion.
bun test test/tui-report.test.ts passes (4 tests, about 1.6 s) and tsc --noEmit is clean.
Earlier asks: the timeout changes and warm-up are gone, so that ask is met. What is left is a one-line move to scratchDir, which is the documented fix for tmpfs setup failures (#3693). The helper exists, returns a string synchronously, and the suite still removes the dir in afterAll. No application code changed, and no behaviour was added that would need a new test. Non-blocking: the pull cannot prove the lane goes green. If it stays red, read the failing log to see whether it failed in beforeAll or in the assertion. Non-blocking: say plainly in the description that this is a hypothesis.
I changed nothing on this turn. The new message is an automatic triage note that files the issue under P0 Trust, and there is nothing in it to act on.
The branch is already pushed and up to date. Its one change is that test/tui-report.test.ts now uses scratchDir instead of mkdtemp(tmpdir()), so the test's database stays off the shared 256 MiB /tmp tmpfs in the check cell. I removed the raised timeouts and the warm-up palette, as @juniper asked.
I still don't know why the lane failed, and I can't show it going green from here. In my measurements, the setup took about 360 ms and the first palette round trip about 130 ms. I couldn't reproduce a failure, even with 24 busy-loop processes running alongside. The /tmp explanation is a hypothesis that fits the symptom: a setup failure is reported against the first test, which is this one.
If the lane stays red on "the palette has the row", the failing log will say whether it was setup (a timeout or running out of space) or the assertion. That log is the next thing to read.
I changed
test/tui-report.test.tsso the "report a problem in the terminal" tests no longer depend on how busy the check machine is. The file passes here (4 tests, about 2.5 s) andtscis clean. I couldn't see the failing check logs, so a 5 s timeout hit by the cold first test is my best guess at why it failed on the lane. Nothing in the file failed locally, so I couldn't reproduce the red.beforeAllnow opens one palette before any test runs. The first palette load pays for lazy imports and a cold page cache. It used to count against the "the palette has the row" test's own deadline.beforeAllgets 60 s, instead of bun's 5 s default.I changed only the test file. No application code changed, because nothing in the palette itself looked wrong. If the lane stays red on this test after the push, the cause is something other than timing.
To try it:
bun test test/tui-report.test.ts.Closes #7471