Skip to content

test: deflake TestRetryBehavior - #4653

Merged
igorbernstein2 merged 1 commit into
mainfrom
test/deflake-retry-behavior
Dec 1, 2026
Merged

igorbernstein2 merged 1 commit into
mainfrom
test/deflake-retry-behavior

Conversation

@igorbernstein2

@igorbernstein2 igorbernstein2 commented Dec 1, 2026 •

Copy link
Copy Markdown
Collaborator

Fixes two pre-existing flakes in TestRetryBehavior:

  1. testRpcWillRespectAttemptTimeout (expected >= PT0.44S, but was [PT0.437S]):
    • Widen the attempt-timeout tolerance (5ms/10ms -> 100ms via DEADLINE_TOLERANCE) so loopback transit and thread scheduling jitter no longer trip the assertion.
    • Replace per-RPC Mockito.mock(ServerCall.Listener.class) in the server interceptor with new ServerCall.Listener<ReqT>() {}, and record remainingDurations before incrementing callCount.
  2. testRpcWillRetryOnAbort[scan] (expected: ABORTED, but was: DEADLINE_EXCEEDED):
    • Accept either ABORTED or DEADLINE_EXCEEDED as the terminal status when retrying ABORTED until the overall operation timeout (callCount >= 9 still verifies that ABORTED was retried).

@igorbernstein2
igorbernstein2 requested a review from a team as a code owner December 1, 2026 18:15
@product-auto-label product-auto-label Bot added size: m Pull request size is medium. api: bigtable Issues related to the googleapis/java-bigtable-hbase API. labels Dec 1, 2026

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
igorbernstein2 force-pushed the test/deflake-retry-behavior branch from ca3d306 to e20818b Compare December 1, 2026 19:18
@product-auto-label product-auto-label Bot added size: s Pull request size is small. and removed size: m Pull request size is medium. labels Dec 1, 2026
@igorbernstein2
igorbernstein2 merged commit 533c1d9 into main Dec 1, 2026
18 checks passed
@igorbernstein2
igorbernstein2 deleted the test/deflake-retry-behavior branch December 1, 2026 22:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api: bigtable Issues related to the googleapis/java-bigtable-hbase API. size: s Pull request size is small.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants