0
Fork 0
mirror of https://github.com/TanStack/router.git synced 2026-11-18 19:34:24 +00:00
router/e2e/react-router/basic-react-query
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
..
src examples: <ScrollRestoration/> => scrollRestoration: true 2025-01-30 15:44:57 -07:00
tests fix: upgrade to vinxi 0.5 and vite 6 (#2923) 2024-12-06 00:36:10 +01:00
.gitignore chore(e2e): move hash related test utils to the shared package (#3782) 2025-03-16 14:24:39 +13:00
index.html chore(e2e,examples): tailwindcss v4 (#3235) 2025-01-26 17:50:21 +13: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 chore(e2e,examples): downgrade to tailwindcss 3 (#3249) 2025-01-27 13:28:27 +13:00
tailwind.config.mjs chore(e2e,examples): downgrade to tailwindcss 3 (#3249) 2025-01-27 13:28:27 +13:00
tsconfig.json test(e2e): derive e2e testing ports from the package name (#2939) 2024-12-07 10:53:11 +13:00
vite.config.js chore(e2e,examples): downgrade to tailwindcss 3 (#3249) 2025-01-27 13:28:27 +13:00