Skip to content

[Fixit][CI] Fix flakiness for StartsConnectingFromRandomIndex #42198

Closed
pawbhard wants to merge 1 commit into
grpc:masterfrom
pawbhard:rr_flake
Closed

[Fixit][CI] Fix flakiness for StartsConnectingFromRandomIndex #42198
pawbhard wants to merge 1 commit into
grpc:masterfrom
pawbhard:rr_flake

Conversation

@pawbhard

Copy link
Copy Markdown
Contributor

cmake/build/round_robin_test --gtest_filter=RoundRobinTest.StartsConnectingFromRandomIndex

Root Cause: we have 3 index 0,1, 2 and we query to get starting index. We expect to get a random index, so test assert we get something other than 0. the probability is 1/3 we do this 10 times , so failure probability becomes (1/3)^10 approx 0.0017% . That is the reason we have not seen many instance of this failure.

Increasing the loop count to 30. (This will not increase test time as we will return early as soon as we get index other than 0). This will have failure probability (1/3)^30 ~ 10^ -15 (almost impossible)

@pawbhard pawbhard requested a review from rishesh007 April 22, 2026 08:06
@pawbhard pawbhard self-assigned this Apr 22, 2026
@pawbhard pawbhard added the release notes: no Indicates if PR should not be in release notes label Apr 22, 2026
asheshvidyut pushed a commit to asheshvidyut/grpc that referenced this pull request Apr 23, 2026
…2198)

cmake/build/round_robin_test --gtest_filter=RoundRobinTest.StartsConnectingFromRandomIndex

Root Cause: we have 3 index 0,1, 2 and we query to get starting index. We expect to get a random index, so test assert we get something other than 0. the probability is 1/3 we do this 10 times , so failure probability becomes (1/3)^10 approx 0.0017%  . That is the reason we have not seen many instance of this failure.

Increasing the loop count to 30. (This will not increase test time as we will return early as soon as we get index other than 0). This will have failure probability (1/3)^30 ~ 10^ -15 (almost impossible)

Closes grpc#42198

COPYBARA_INTEGRATE_REVIEW=grpc#42198 from pawbhard:rr_flake 9a71e0b
PiperOrigin-RevId: 903699099
asheshvidyut pushed a commit to a-detiste/grpc that referenced this pull request Jun 10, 2026
…2198)

cmake/build/round_robin_test --gtest_filter=RoundRobinTest.StartsConnectingFromRandomIndex

Root Cause: we have 3 index 0,1, 2 and we query to get starting index. We expect to get a random index, so test assert we get something other than 0. the probability is 1/3 we do this 10 times , so failure probability becomes (1/3)^10 approx 0.0017%  . That is the reason we have not seen many instance of this failure.

Increasing the loop count to 30. (This will not increase test time as we will return early as soon as we get index other than 0). This will have failure probability (1/3)^30 ~ 10^ -15 (almost impossible)

Closes grpc#42198

COPYBARA_INTEGRATE_REVIEW=grpc#42198 from pawbhard:rr_flake 9a71e0b
PiperOrigin-RevId: 903699099
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.

2 participants