Summary
The ecosystem integration test harness can report a generic Vitest beforeAll timeout while leaving the fixture dev server running. This showed up on PR #1130 in Vitest (integration 1/3) for the better-auth fixture.
Evidence
The failed shard timed out in tests/ecosystem.test.ts at the better-auth beforeAll hook:
Error: Hook timed out in 90000ms.
❯ tests/ecosystem.test.ts:333:3
The GitHub cleanup step then terminated an orphaned process for the same fixture:
npm exec vp dev --port 4404 --strictPort
Running the same target locally passed quickly:
vp test run tests/ecosystem.test.ts -t "better-auth"
# passed in 8.2s
Likely root cause
STARTUP_TIMEOUT_MS is used for both the internal fixture readiness deadline and the Vitest hook timeout. Those deadlines race, so Vitest can kill the hook before startFixture() rejects with the buffered server output. Because the proc variable is only assigned after startFixture() resolves, afterAll(() => killProcess(proc)) cannot clean up the child process when startup fails.
The readiness probe also requests /, which includes first SSR compilation work, so CI load can make startup readiness much more variable than simple port binding.
Expected fix
- Ensure
startFixture() owns cleanup on startup failure and timeout.
- Give Vitest hooks a timeout larger than the internal readiness deadline so startup failures surface the diagnostic error.
- Preserve the existing fixture behavior while making failures deterministic and diagnosable.
- Consider fixing the
better-auth fixture default baseURL mismatch (4403 default while the test starts on 4404).
Summary
The ecosystem integration test harness can report a generic Vitest
beforeAlltimeout while leaving the fixture dev server running. This showed up on PR #1130 inVitest (integration 1/3)for thebetter-authfixture.Evidence
The failed shard timed out in
tests/ecosystem.test.tsat thebetter-authbeforeAllhook:The GitHub cleanup step then terminated an orphaned process for the same fixture:
Running the same target locally passed quickly:
Likely root cause
STARTUP_TIMEOUT_MSis used for both the internal fixture readiness deadline and the Vitest hook timeout. Those deadlines race, so Vitest can kill the hook beforestartFixture()rejects with the buffered server output. Because theprocvariable is only assigned afterstartFixture()resolves,afterAll(() => killProcess(proc))cannot clean up the child process when startup fails.The readiness probe also requests
/, which includes first SSR compilation work, so CI load can make startup readiness much more variable than simple port binding.Expected fix
startFixture()owns cleanup on startup failure and timeout.better-authfixture defaultbaseURLmismatch (4403default while the test starts on4404).