Repository navigation
test: deflake TestRetryBehavior - #4653
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Code Review
This pull request refactors TestRetryBehavior.java to improve test reliability and reduce flakiness under CI jitter. Key changes include introducing a warmUp method to prime the gRPC channel, extracting timeouts directly from metadata headers to avoid loopback transit delays, and adding explicit tolerance durations for assertions. The feedback suggests adding a null check for fakeServer in the teardown method to prevent a NullPointerException from masking setup failures.
igorbernstein2
force-pushed
the
test/deflake-retry-behavior
branch
from
December 1, 2026 19:18
ca3d306 to
e20818b
Compare
nimf
approved these changes
Dec 1, 2026
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.
Fixes two pre-existing flakes in
TestRetryBehavior:testRpcWillRespectAttemptTimeout(expected >= PT0.44S, but was [PT0.437S]):5ms/10ms->100msviaDEADLINE_TOLERANCE) so loopback transit and thread scheduling jitter no longer trip the assertion.Mockito.mock(ServerCall.Listener.class)in the server interceptor withnew ServerCall.Listener<ReqT>() {}, and recordremainingDurationsbefore incrementingcallCount.testRpcWillRetryOnAbort[scan](expected: ABORTED, but was: DEADLINE_EXCEEDED):ABORTEDorDEADLINE_EXCEEDEDas the terminal status when retryingABORTEDuntil the overall operation timeout (callCount >= 9still verifies thatABORTEDwas retried).