Skip to content

Backport: fix flaky Test_grpcConnectionManager_Peers (#4276)#4381

Merged
reinkrul merged 1 commit into
V6.2from
fix/flaky-grpc-peers-test-v6.2
Jul 1, 2026
Merged

Backport: fix flaky Test_grpcConnectionManager_Peers (#4276)#4381
reinkrul merged 1 commit into
V6.2from
fix/flaky-grpc-peers-test-v6.2

Conversation

@reinkrul

@reinkrul reinkrul commented Jul 1, 2026

Copy link
Copy Markdown
Member

Summary

Backports #4276 (already on master since d6ab80f) to V6.2.

Test_grpcConnectionManager_Peers/inbound_stream_triggers_observer (and the mirror outbound subtest) sets Authenticate expectations on both peers' mocks, but only waited for one side's observer before tearing down. When the unobserved side's authentication was still in flight, t.Cleanup ran gomock's Finish() before that call landed, reporting a missing call.

V6.2 never received this fix, so PRs targeting this branch (e.g. #4374) still hit the flake — see #4380.

Test plan

  • go test -race -count=20 -run Test_grpcConnectionManager_Peers ./network/transport/grpc/ passes locally

Fixes #4380

…g down (#4276)

Test_grpcConnectionManager_Peers/inbound_stream_triggers_observer and the
mirror outbound subtest set Authenticate expectations on both peer's
authenticator mocks but only waited for one side's observer to fire before
calling cm2.Stop(). When the observed side won the race, the other side's
authenticator could still be in flight when t.Cleanup ran gomock's Finish(),
reporting a missing call.

Extend the wait condition to also require the unobserved side's Peers() list
to be populated, which only happens after that side's Authenticate returns.

Assisted-by: AI
@qltysh

qltysh Bot commented Jul 1, 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.

@reinkrul
reinkrul merged commit 9106ca7 into V6.2 Jul 1, 2026
8 of 9 checks passed
@reinkrul
reinkrul deleted the fix/flaky-grpc-peers-test-v6.2 branch July 1, 2026 08:24
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.

2 participants