test(runtime-tests): run the main suite concurrently by default
Enable sequence.concurrent: true in vite.config.ts so the non-PTY suite runs
concurrently like the PTY suite. Stress-verified stable (8/8 at maxForks=4);
the suite drops from ~13s to ~4-5s.
Three test patterns were incompatible with concurrency; handled per cause:
- Inline snapshots (background-color, borders): the module-level `expect`
loses snapshot test context under concurrency. Fixed in place by using the
context-local `expect` (async ({ expect }) => ...), so they stay concurrent.
- Process-global state (throttle/animation-scheduler use fake timers; leak
asserts on process exit/SIGINT listener counts and live yoga nodes): a
concurrent sibling clobbers the shared global mid-test. These genuinely
require serial execution, so they move to *.sequential.test.* files with
it.sequential / describe.sequential and a header explaining why.
`vp run ready` passes.
This commit is contained in:
@@ -6,6 +6,10 @@ export default defineConfig({
|
||||
test: {
|
||||
// chalk disables color in non-TTY envs; force it on so ANSI style bugs don't hide from tests
|
||||
env: { FORCE_COLOR: "3" },
|
||||
// Tests run concurrently by default. Tests that genuinely need serial
|
||||
// execution (process-global fake timers) live in their own *.sequential
|
||||
// files. Snapshot tests stay concurrent by using the context-local expect.
|
||||
sequence: { concurrent: true },
|
||||
// PTY tests run separately via vitest.pty.config.ts (they need node-pty's forks pool and a longer timeout)
|
||||
exclude: ["integration/pty/**", "node_modules/**"],
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user