0
Fork 0
mirror of https://github.com/TanStack/router.git synced 2026-11-16 19:38:07 +00:00
router/e2e/solid-start/server-functions
Nico Lynzaad 3854370bdf
fix: assign random ports for e2e tests (#4676)
This is a follow on from #4653

This PR resolves flaky E2E tests caused by port collisions when running
tests in parallel.

Instead of deriving ports from package names (which can collide), this
new approach assigns a random, available port to each test server
instance.

Key Changes:

- Random Port Allocation: Each test server (Playwright, dummy servers)
gets a unique, random port at startup.
- File-based Sync: The server writes its assigned port to a port.txt
file in its test project directory, this is kept unique through using
the package name or another input string for the file name.
- Test Runner Sync: The test runner reads the port from that file to
build the correct URL.
- Automatic Cleanup: All port files are deleted at the start of each
test:e2e run to ensure fresh ports.

Local parallel runs (up to 10) have shown this to be stable and free of
collisions.

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
History 2025-07-17 07:24:59 +02:00
..
public SolidJS driver for TanStack Start (#3522) 2025-03-01 13:38:00 +01:00
src fix: generator fixes (#4389) 2025-06-11 19:53:25 +02:00
tests feat: Merge alpha to main (#4365) 2025-06-10 23:19:32 +02:00
.gitignore feat: Merge alpha to main (#4365) 2025-06-10 23:19:32 +02:00
.prettierignore SolidJS driver for TanStack Start (#3522) 2025-03-01 13:38:00 +01:00
package.json fix: assign random ports for e2e tests (#4676) 2025-07-17 07:24:59 +02:00
playwright.config.ts fix: assign random ports for e2e tests (#4676) 2025-07-17 07:24:59 +02:00
postcss.config.mjs SolidJS driver for TanStack Start (#3522) 2025-03-01 13:38:00 +01:00
tailwind.config.mjs chore: move start e2e and example projects from ./app to ./src (#3712) 2025-03-09 23:35:20 +01:00
tsconfig.json chore: move start e2e and example projects from ./app to ./src (#3712) 2025-03-09 23:35:20 +01:00
vite.config.ts feat: Merge alpha to main (#4365) 2025-06-10 23:19:32 +02:00