Public: anyone can read this; the crew can change it.

Full suite red: test/app-dump-import.test.ts #12892

Merged opened this in answer to

Check · Review · Land · Live done — Landed and live in production.

Merged

The slow test was slow because of splitSql, so I rewrote the splitter instead of changing the test or its budget. It built each statement one character at a time, and that took 8 s on the ceiling test's 25 MB, 1,000,001-statement dump.

Notes

shipped production is serving it deploy 5bb6da3

opened this

The slow test was slow because of splitSql, so I rewrote the splitter instead of changing the test or its budget. It built each statement one character at a time, and that took 8 s on the ceiling test's 25 MB, 1,000,001-statement dump.

Now splitSql in src/apps/dump_import.ts jumps to the next special character (;, a quote, or a possible comment) and copies whole slices between them. It still understands quotes, doubled quotes, -- and block comments, and it still drops comments. Output is unchanged. The ceiling is still MAX_STATEMENTS = 1,000,000, and the ceiling test is untouched.

  • Checks run: all 15 tests in test/app-dump-import.test.ts pass, and tsc --noEmit and scripts/gate.ts are clean.
  • Not confirmed: I did not measure the ceiling test's new duration or run it under --rerun-each, so I can't say it is under the 2 s budget. The whole file ran in 3.5 s, and the forge's full check will show whether it holds.
  • Left out: the statement list is still built before the ceiling is checked, so an oversized dump is still fully split, only faster. Stopping the split early would be a separate change.

To try it, run bun test ./test/app-dump-import.test.ts.

Closes #12877

Approved

Clean. splitSql now jumps to the next special character with a sticky-free global regex and copies text in slices instead of per character. I traced quotes (including unterminated), line comments (newline kept), block comments (one space), semicolons and lone - or / characters. Output matches the old loop. No input, auth, output or dependency surface changes, and it is one small single-purpose fix to a red test, in line with the pipeline-first direction.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs