test(network): re-add Test_conn_startSending with deterministic ordering - #4434
Open
stevenvegt wants to merge 1 commit into
Open
test(network): re-add Test_conn_startSending with deterministic ordering#4434stevenvegt wants to merge 1 commit into
stevenvegt wants to merge 1 commit into
Conversation
The test was removed in #2618 because it was flaky: it cancelled the stream before calling disconnect(), racing the receive goroutine (which stores the stream error as close status) against disconnect() cancelling the connection context. Disconnecting first guarantees the context is cancelled before RecvMsg returns, making the test deterministic while restoring the goroutine-exit and no-panic coverage. Verified with -race -count=100. Assisted-by: AI
stevenvegt
requested review from
Dirklectisch,
JorisHeadease,
gerardsn,
reinkrul and
woutslakhorst
as code owners
July 27, 2026 16:40
Contributor
0 new issues
|
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.
Summary
Re-adds
Test_conn_startSending/disconnect_does_not_panic, which was removed in #2618 because it was flaky. The flake was one over-specified assertion: the test cancelled the stream before callingdisconnect(), racing the receive goroutine (which stores the stream error as close status) againstdisconnect()cancelling the connection context.Disconnecting first makes the test deterministic and restores coverage for goroutine exit and the disconnect panic guard (#1017). Companion PRs: #4432 (same re-add on V6.2), #4431 (reorder-only fix on V5.4, which still had the racy version and flaked on #4425).
Verified with
go test -race -count=100: 100/100 pass.Assisted-by: AI