GeezerVison is showing github.com — test: fix flaky raw-socket and form body tests on Windows by mcollina · Pull Request #215 · fastify/fastify-express
Conversation
mcollina
commented
Nov 20, 2026
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this page.
Two test flakes keep CI red on Windows.
The raw-socket helpers in test/absolute-form-url.test.js and test/url-encoding.test.js sent the request with socket.end(), which half-closes the connection. Node.js aborts a request that is still in flight when the client ends its side, so a response written asynchronously never arrives and the helper fails reading the status line (Cannot read properties of null (reading '1')). The helpers now write the request and let Connection: close end the connection after the response.
Three tests in test/form-data.test.js aborted a request expected to succeed after 100 ms, which the first request on a slow Windows runner can exceed (566 ms on Node.js 20). The timeout only guards against a hang, so it is now 5 s; the test that expects the request to hang keeps its short timeout.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
The raw-socket helpers sent the request with socket.end(), which
half-closes the connection. Node.js aborts a request still in flight
when the client ends its side, so a response written asynchronously
was lost and the helper failed reading the status line. This happened
on Windows CI, where the end of the stream is seen sooner. Write the
request instead and let Connection: close end the connection.
Three form body tests aborted their request after 100 ms, which the
first request on a slow Windows CI runner can exceed (566 ms on Node.js
20). The timeout only guards against a hang, so make it 5 s. The test
that expects the request to hang keeps its short timeout.
mcollina
changed the title
test: keep raw test connections open until the response
test: fix flaky raw-socket and form body tests on Windows
Nov 20, 2026
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Assignees
No one assigned
Milestone
No milestone
Development
Successfully merging this pull request may close these issues.
Uh oh!
There was an error while loading. Please reload this page.
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.