-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Improve miniflare test stability #11642
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
🦋 Changeset detectedLatest commit: eb10e46 The changes in this PR will be included in the next version bump. Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
479b2bb to
f557e60
Compare
4134d07 to
688b106
Compare
create-cloudflare
@cloudflare/kv-asset-handler
miniflare
@cloudflare/pages-shared
@cloudflare/unenv-preset
@cloudflare/vite-plugin
@cloudflare/vitest-pool-workers
@cloudflare/workers-editor-shared
@cloudflare/workers-utils
wrangler
commit: |
41d5d16 to
574eab3
Compare
|
Claude finished @petebacondarwin's task —— View job Changeset Review✅ All changesets look good The changeset
|
8e1ec64 to
8cad69f
Compare
|
Oops I forgot to remove the "blasting Windows" commit. |
cf04605 to
a198713
Compare
These tests will need to download the Chrome browser in the background, which can take quite a few seconds sometimes.
In particular the dev-registry tests appear to be particularly sensitive to concurrency issues, likely due to shared ports/sockets.
a198713 to
eb10e46
Compare
* update to latest ava * Display error `cause` in Miniflare tests * hide unwanted logging from Miniflare browser plugin tests * quieten Miniflare secrets-store plugin tests * quieten Miniflare Durable Object plugin tests * quieten other Miniflare tests * Retry removing the Browser Session temp directory * Give the Miniflare browser plugin tests a bit longer to complete These tests will need to download the Chrome browser in the background, which can take quite a few seconds sometimes. * silence Miniflare pipeline plugin tests * Silence Miniflare unsafe plugin tests * don't run miniflare tests files concurrently to flakes In particular the dev-registry tests appear to be particularly sensitive to concurrency issues, likely due to shared ports/sockets. * run the Miniflare dev-registry tests in series (rather than parallel) * fix typo * quieten unwanted logging from Miniflare dev-registry tests * no keep-alive * add changeset * no keep-alive * fix changeset * fix lockfile * fix changeset (again) * mark Miniflare browser tests as flaky
The Miniflare unit tests flake fairly often on Windows (and occasionally on other OSes). The errors are a bit difficult to debug because Ava only renders "Fetch failed" and not the
causethat contains the actual useful info.Errors
The patch to the concordance library exposes the
causefor these errors, such as:Diagnosis
This can be caused by a race condition between Undici's Keep-Alive mechanism and the Miniflare/Workerd server.
Fix
The fix is to prevent Undici from trying to keep the connection alive.
Connection: closeheader to the request to force undici to use a new connection for each request. But this felt a bit invasive on the request (and also this header is disallowed for HTTP.reset: truewhich has the same effect of preventing Undici from trying to keep the connection alive. See docs here.Extras
In addition to the main fix, this PR also quietens/silences a lot of the other miniflare tests that were dumping unnecessary and distracting logs into the test output.
A picture of a cute animal (not mandatory, but encouraged)