Repository navigation
e2e: the dev server no longer watches Playwright's output; story requests use their own connection - #54
Merged
Conversation
…ests use their own connection console-mock-stories failed about one run in two, each time in a different story. - Vite watched e2e/results, where Playwright keeps every story's trace for the life of the worker. The server's one thread saturated as that tree grew, every request through it slowed with each story, and long stories ran past their timeout. vite.config.ts now excludes e2e/results and playwright-report from the watcher. - page.request reused a keep-alive socket the dev server was closing (ECONNRESET). The request fixture sends every request on its own connection; stories use it instead of page.request.
Contributor
Author
|
CI measurement for this PR (run 47329464538, first attempt, all jobs green), against the two failing attempts that ran longest:
The stories that timed out: One green run does not prove the ECONNRESET race is gone (it showed once in six attempts); the fixture change removes socket reuse, which is its cause. |
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.
Problem
console-mock-storiesfailed in 4 of the last 6 attempts on #52 andmain, each time in a different story:app-create-destinationapiRequestContext.get: read ECONNRESETdiscover-navigationapp-settings-updatediscover-navigationpage.goto)Cause 1: the Vite dev server watched Playwright's output (the timeouts)
Evidence from the HTML reports of those attempts: the
mockResetfixture (two POSTs through Vite to the mock, the same in every story) takes ~90 ms in a fresh worker and grows with every story the worker has run, up to ~900 ms after 75 stories. It drops back to ~90 ms right after a failure restarts the worker. The same stories take 2-3x longer late in a worker (discover-navigation: 24 s after 59 stories, over its 30 s limit after 81).outputDirise2e/results, inside the directory Vite serves. Playwright keeps each story's trace there until the worker ends (.playwright-artifacts-<worker>, ~10,800 files by the end of a run). Vite ignores Playwright's defaulttest-resultsbut not this path, so its watcher follows the growing tree and the server's one thread saturates.Local measurement, same 35 stories, one worker:
Before the change Vite reached ~93% of one core in the last third of the run. Direct requests to the mock stayed at 0.3 ms throughout, so the mock is not involved.
Fix:
server.watch.ignoredexcludese2e/resultsandplaywright-report.Cause 2:
page.requestreused a closing keep-alive socket (the ECONNRESET)#17 fixed this race for the mock control requests only. 14 story reads went through
page.request, which pools sockets; the failing one wasapp-create-destination.mock.spec.ts:73.Fix: the
requestfixture sends every request withconnection: close(checked against a counting server: 5 requests, 5 sockets; the default context used 1). The 14page.requestreads use the fixture, and the per-call header inmockControlis gone.Verification
bun run typecheck:e2e,bun run typecheck: clean.Not verified locally: the CI runner itself. This PR's
console-mock-storiesrun is the first measurement there.