0
Fork 0
mirror of https://github.com/TanStack/router.git synced 2026-11-16 19:38:07 +00:00
router/e2e/react-start/basic-auth
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
..
prisma refactor(react-start): rename e2e/start to e2e/react-start (#3565) 2025-02-25 22:37:01 +01:00
public refactor(react-start): rename e2e/start to e2e/react-start (#3565) 2025-02-25 22:37:01 +01:00
src chore(examples): move beforeLoad property before head in createFileRoute (#4504) 2025-06-24 15:11:02 +12:00
tests refactor(react-start): rename e2e/start to e2e/react-start (#3565) 2025-02-25 22:37:01 +01:00
.env refactor(react-start): rename e2e/start to e2e/react-start (#3565) 2025-02-25 22:37:01 +01:00
.gitignore feat: Merge alpha to main (#4365) 2025-06-10 23:19:32 +02:00
.prettierignore refactor(react-start): rename e2e/start to e2e/react-start (#3565) 2025-02-25 22:37:01 +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 refactor(react-start): rename e2e/start to e2e/react-start (#3565) 2025-02-25 22:37:01 +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