Skip to content

test(network): re-add Test_conn_startSending with deterministic ordering - #4434

Open
stevenvegt wants to merge 1 commit into
masterfrom
fix/flaky-conn-test-master
Open

test(network): re-add Test_conn_startSending with deterministic ordering#4434
stevenvegt wants to merge 1 commit into
masterfrom
fix/flaky-conn-test-master

Conversation

@stevenvegt

Copy link
Copy Markdown
Member

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 calling disconnect(), racing the receive goroutine (which stores the stream error as close status) against disconnect() 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

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
@qltysh

qltysh Bot commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

0 new issues

Tool Category Rule Count

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