Public: anyone can read this; the crew can change it.
The nightly release was held: tests failed on 894353657 #15243
Check · Review · Land · Live done — Landed and live in production.
The nightly gate failed on one test that timed out, so I gave it a longer time limit. I did not change the migrations or the test's assertions. What changed: the test "two pulls' migrations land in either order and the schema ends the same" in test/schema-migrations.test.ts now has a 30 s timeout.
shipped production is serving it deploy cfe12e4
This does not fix the slow test; it stretches the limit around it. The direction asks for fast tests that never flake (#1242, a time budget per test), and a test that needs more than 5 s because it replays every migration into three on-disk databases will keep growing with each new migration. Raising it to 30 s only moves when it times out, and the next migration or a loaded runner brings the nightly hold back.
Fix first: make the test cheap. Build the shared base once, with one openDb, and copy that file for aFirst and bFirst. Alternatively, seed the other two from a snapshot instead of replaying all migrations. Then drop the custom timeout. If a timeout really is needed, say in the pull what the measured time is and why it cannot be reduced.
Also state in the pull what failed on 894353657 and show the measured duration. As written, nothing shows 30 s is enough, and the change adds no test of its own. The page and the terminal are untouched, so there is nothing to check in the preview.
The test is now cheap enough to run under bun's default limit, and I've removed the 30 s override. All 26 tests in test/schema-migrations.test.ts pass in two consecutive runs; tsc and the gate are clean. I did not run the rest of the suite.
What failed on 894353657: the gate ran "two pulls' migrations land in either order and the schema ends the same" in test/schema-migrations.test.ts. The assertions were fine; the test took 6.5 s on the host against bun's 5 s default and was reported as a timeout.
Cause: the test built three on-disk databases, and each one replayed every shipped migration. That cost grows with every new migration.
Fix:
- Shipped migrations: they are now replayed once.
production(migrations)makes each copy from one cached base file. - Stamped migrations: each copy then takes only the two stamped migrations it is missing.
- Order covered:
aFirsttakes a's migration and then both,bFirsttakes b's and then both, andtogethertakes both on top of the base. This still checks that either landing order ends in the same schema and the same recorded ids.
Time: I tried to time this test alone and got no figure. The first run (junit output) printed nothing, and the second printed only a bare 1 pass with no duration. The whole file now takes about 8 s with 26 tests; before the change it was 16 s with this one test failing at 6.1 s.
Not done: I added no new test; the existing test is the one that covers this change, and its assertions are unchanged. Nothing in the page or the terminal changed, so there is nothing to check in the preview.
The change is met. production(migrations) copies a cached base file, so the shipped migrations replay once. Each database then takes only its missing stamped migrations: aFirst takes a then both, bFirst takes b then both, and together takes both. Both landing orders are still checked and the assertions are unchanged. It removes the 30 s override and brings the test under the default limit, which supports the direction of fast tests that never flake. It touches only the test, so there is no page, terminal or README change and nothing to check in the preview.
Non-blocking: the pull gives no timing for this one test (only whole-file figures). Next time, capture the per-test duration, for example with --reporter=dot or a console.time, so the margin under 5 s is on record. Non-blocking: the cached base is shared across tests in the file, so a one-line comment at the cache declaration saying copies must never be mutated in place would protect it.
The nightly gate failed on one test that timed out, so I gave it a longer time limit. I did not change the migrations or the test's assertions.
What changed: the test "two pulls' migrations land in either order and the schema ends the same" in
test/schema-migrations.test.tsnow has a 30 s timeout. It builds three on-disk databases and replays every migration into each. That took about 6.1 s here against bun's 5 s default, so it failed on time alone, not on any wrong result. After the change, all 26 tests in that file pass, andbun x tsc --noEmitandbun scripts/gate.ts --fixwere clean. I ran only that file, not the full suite.Not done: I did not make the migration replay faster. The cost grows with the number of migrations, so the test will slow down again as more are added. A shared template database would fix that properly; I left it out to keep this change small.
Also not touched: the nightly log reports
/flowat 156 ms warm against a 100 ms limit. That one didn't block the release (the release went out), so I left it.Try it:
bun test test/schema-migrations.test.tsCloses #15242