Skip to content

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

Open
stevenvegt wants to merge 1 commit into
V6.2from
fix/flaky-conn-test-v6.2
Open

test(network): re-add Test_conn_startSending with deterministic ordering#4432
stevenvegt wants to merge 1 commit into
V6.2from
fix/flaky-conn-test-v6.2

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: same re-add on master, reorder-only fix on V5.4 (which still had the racy version).

Verified with go test -race -count=100: 100/100 pass.

Assisted-by: AI

The test was removed on master 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

@qltysh

qltysh Bot commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

Qlty


Coverage Impact

This PR will not change total coverage.

🚦 See full report on Qlty Cloud »

🛟 Help
  • Diff Coverage: Coverage for added or modified lines of code (excludes deleted files). Learn more.

  • Total Coverage: Coverage for the whole repository, calculated as the sum of all File Coverage. Learn more.

  • File Coverage: Covered Lines divided by Covered Lines plus Missed Lines. (Excludes non-executable lines including blank lines and comments.)

    • Indirect Changes: Changes to File Coverage for files that were not modified in this PR. Learn more.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant