fix(ci): wait for e2e port to free between suite spawns#48
Merged
Conversation
`scripts/run-e2e-suite.mjs` runs each `*.e2e.test.ts` file as its own `vitest run` child process, but didn't wait for the previous Nuxt server to release port 4327 before spawning the next suite. On CI this intermittently surfaces as `listen EADDRINUSE: address already in use 127.0.0.1:4327` followed by `GetPortError: Timeout waiting for port 4327 after 20 retries with 500ms interval`, skipping the affected suite's tests (most recently observed on PR #47, run 25912452254). Every e2e file hard-codes `setupBrowserE2E(4327)`, so polling the single shared port between suites is the minimal fix — no test-file changes and no change to how Nuxt is booted. The check uses a short-lived listener on the same port as a probe and bails after 15s with a clear error.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
PR #47 CI'sinde
tests/e2e/project-content-review.e2e.test.tsGetPortError: Timeout waiting for port 4327ile patladı (run 25912452254). Log:Bu pre-existing bir test harness race condition — PR #47'nin diff'iyle alâkasız:
scripts/run-e2e-suite.mjsher*.e2e.test.tsdosyasını ardışık ayrı birvitest runchild process'i olarak başlatıyor.setupBrowserE2E(4327)ile Nuxt'u aynı sabit port'a kaldırıyor (tests/e2e/*.e2e.test.ts).EADDRINUSE→ 20×500ms port-wait timeout → suite'in testleri skipped olarak işaretleniyor.Fix
run-e2e-suite.mjsartık her suite arasında port 4327'nin gerçekten serbest kaldığını polling ile doğruluyor (yeni listener probe'u, 200ms aralık, 15s timeout). Magicsleepyok; gerçek koşulu bekliyoruz. Test dosyalarına dokunmadım, Nuxt boot sequence'ına dokunmadım — minimal, lokal fix.Changes
scripts/run-e2e-suite.mjs—isPortFree+waitForPortFreehelper, suite döngüsünün sonundaawait waitForPortFree(4327, '127.0.0.1', 15_000).Test plan
no-consolewarning).isPortFree → false, kapandıktan sonratrue.Follow-up
İleride birden fazla e2e suite'i paralel koşturmak istersek her dosyaya unique port atamak ya da
setupBrowserE2E()argümansız + dinamik port allocation'a geçmek gerekecek. Şimdilik kapsam dışı.