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

Full suite red: test/flows-actions.test.ts #17880

opened this in answer to

Merged 24h 19m ago, live in production

test/flows-actions.test.ts now seeds the preview world once and copies it for each test. The file takes 2.8 s, down from 9.4 s before. The --rerun-each 3 run passed 24 of 24 earlier, and the plain run still passes 8 of 8 after the comment rewrap.

Notes

opened this

test/flows-actions.test.ts now seeds the preview world once and copies it for each test. The file takes 2.8 s, down from 9.4 s before. The --rerun-each 3 run passed 24 of 24 earlier, and the plain run still passes 8 of 8 after the comment rewrap. tsc --noEmit is clean, and bun scripts/gate.ts --fix rewrapped one comment, which I committed.

Cause: beforeEach ran seedPreview before every test, about 1.4 s each. The first test paid that in its own CPU time and went over the 2 s budget.

Change: the first seedPreview now runs once in beforeAll and the app is closed. Each test then copies that data directory and boots the app and servers on the copy, so tests stay isolated. The test bodies are unchanged. Only test/flows-actions.test.ts changed.

Left out: I did not make seedPreview itself cheaper. I did not run the repeated runs against the full suite's sharding either, since the forge runs that on push.

To try it: bun test ./test/flows-actions.test.ts --rerun-each 10.

Closes #17879

Sign in to join this conversation.

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

Keyboard shortcuts

Docs