Skip to content

tests: the stop tests' connect probe gives up after 100 ms, so a SYN the closing listener drops no longer outlasts the stop - #657

Merged
MDA2AV merged 1 commit into
mainfrom
fix/stop-probe-flake
Nov 23, 2026
Merged

MDA2AV merged 1 commit into
mainfrom
fix/stop-probe-flake

Conversation

@MDA2AV

@MDA2AV MDA2AV commented Nov 23, 2026 •

Copy link
Copy Markdown
Owner

"stop: a datagram that reaches a socket the stop closed is dropped, not handed to OnDatagram" failed on arm64 with "the stop ended with a handler still holding its connection", on #654 and again on #656. Neither PR reaches it: #656 changes version numbers only. Both times it failed about 1.26 s in.

Its probe (Refuses) connects to the port in a loop until it is refused, while the stop is closing the listener. A SYN that lands as the listener closes is dropped without an answer, so that connect waits a second for TCP to send it again. The stop's own drain is one second, so by the time the test looks, the reactor has ended. 1 s plus the test's 200 ms sleep accounts for it.

The probe now gives up on a connect with no answer in 100 ms and tries again, and the next one is refused at once.

Tests

  • The step, looped on main (start, hold a connection, stop, connect until refused): with the old probe 34 of 4,244 stops were refused only after a second, 1,062 ms at worst. With the new one none of 4,914, and 101 ms at worst.
  • StopDrainTests: 25 of 25 clean runs, and 3 of 3 on one core shared with four busy loops. The other test that uses the probe ("from the stop on its listener refuses connections, while a handler still holds one") makes the same check, so it could fail the same way; it passed too.

Test code only.

Overlap

None of the open PRs touches StopDrainTests.cs.

🤖 Generated with Claude Code

…the closing listener drops no longer outlasts the stop

"stop: a datagram that reaches a socket the stop closed is dropped" failed on arm64 with "the stop ended with a handler still holding its connection", on #654 and again on #656, each time 1.26 s into the test. Its probe connects to the port until it is refused, while the stop closes the listener. A SYN that lands as the listener closes is dropped without an answer, connect waits a second for TCP to send it again, and the stop's one-second drain is over by the time the test looks for the reactor.

Looping that step on main: 34 of 4,244 stops were refused after a second (1,062 ms at worst). With the probe giving up on a connect that has no answer in 100 ms: none of 4,914, 101 ms at worst.
@MDA2AV
MDA2AV merged commit 64b5bd0 into main Nov 23, 2026
2 checks passed
@MDA2AV
MDA2AV deleted the fix/stop-probe-flake branch November 23, 2026 18:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant