Skip to content

test: ecosystem fixture startup timeout can leak dev server #1145

@NathanDrake2406

Description

@NathanDrake2406

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).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions