Skip to content

Fix race in server-close test that flaked on Windows.#166

Merged
floitsch merged 2 commits into
mainfrom
floitsch/make-test-less-flaky
May 24, 2026
Merged

Fix race in server-close test that flaked on Windows.#166
floitsch merged 2 commits into
mainfrom
floitsch/make-test-less-flaky

Conversation

@floitsch
Copy link
Copy Markdown
Member

The test triggered server.close from inside the 10th request handler (before the sleep and response). A flaky Windows CI failure showed the client retrying a request and hitting "actively refused" when the fresh TCP connect raced against the test tearing down the listening socket.

Keep the in-flight close behavior — server.close still fires while the 10th handler is sleeping, so it still has to wait for the handler to drain — but wait for the client to confirm it received all 10 responses before closing the listening socket.

floitsch added 2 commits May 24, 2026 13:28
The test triggered `server.close` from inside the 10th request handler
(before the sleep and response). A flaky Windows CI failure showed the
client retrying a request and hitting "actively refused" when the
fresh TCP connect raced against the test tearing down the listening
socket.

Keep the in-flight close behavior — `server.close` still fires while
the 10th handler is sleeping, so it still has to wait for the handler
to drain — but wait for the client to confirm it received all 10
responses before closing the listening socket.
'in-tenth-handler' / 'ten-done' would go stale if CLOSE-AFTER-REQUESTS
ever changes.
@floitsch
Copy link
Copy Markdown
Member Author

TBR.

@floitsch floitsch merged commit b5c6949 into main May 24, 2026
5 of 7 checks passed
@floitsch floitsch deleted the floitsch/make-test-less-flaky branch May 24, 2026 11:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant