Skip to content

test(showcase): Add gRPC and HttpJson Showcase ITs to verify Retries - #13929

Merged
nnicolee merged 19 commits into
mainfrom
test/showcase-retries
Aug 28, 2026
Merged

test(showcase): Add gRPC and HttpJson Showcase ITs to verify Retries#13929
nnicolee merged 19 commits into
mainfrom
test/showcase-retries

Conversation

@nnicolee

@nnicolee nnicolee commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

Description

This PR expands E2E retry integration tests verifying that client-side retry attempts adhere to configured retry settings and timeout limits across both gRPC and HTTP/JSON transports.

Key Changes

  • SequenceService Client Configuration:
    • Uses client initializer methods in TestClientInitializer for creating SequenceServiceClient instances configured with custom retry parameters and disabled jitter.
  • Expanded Test Coverage:
    • Exponential Backoff: Tests recovery across a standard error sequence (UNAVAILABLE -> UNAVAILABLE -> UNAVAILABLE -> OK).
    • No-Retry Config (maxAttempts = 1): Verifies that single-attempt settings abort immediately on the first error.
    • Non-Retryable Error: Verifies that non-retryable status codes (INVALID_ARGUMENT) halt retries immediately even when maxAttempts > 1.
    • Multiple Retryable Codes: Verifies retrying through a sequence of different retryable status codes (UNAVAILABLE -> RESOURCE_EXHAUSTED -> DEADLINE_EXCEEDED -> OK).
    • RPC Timeout Retries (rpcTimeout): Verifies that attempt timeouts cancel individual calls and trigger retries when server delay exceeds the attempt deadline.
    • Total Timeout Enforcement (totalTimeout): Verifies that cumulative operation deadlines terminate the retry loop with DEADLINE_EXCEEDED when total time expires.
  • Flake-Free Verification:
    • Uses the mock server's stateful SequenceService report polled via Awaitility to verify attempt counts and status code sequences, removing local CPU context-switching scheduling lag as a source of test flakiness.

@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 introduces integration tests for verifying exponential backoff retries on both gRPC and HTTP/JSON clients using the SequenceServiceClient. It also adds corresponding helper methods in TestClientInitializer to initialize these clients with custom retry settings. The feedback suggests simplifying the helper methods in TestClientInitializer by configuring SequenceServiceSettings.Builder directly, which avoids intermediate stub settings and unnecessary object allocations.

@nnicolee
nnicolee marked this pull request as ready for review July 28, 2026 18:42
@nnicolee
nnicolee requested review from a team as code owners July 28, 2026 18:42
@nnicolee
nnicolee requested a review from lqiu96 July 28, 2026 18:43
@nnicolee nnicolee changed the title test(showcase): add integration tests for exponential backoff retries using SequenceService test(showcase): add integration tests for retries Jul 29, 2026
@nnicolee

Copy link
Copy Markdown
Contributor Author

/gemini review

@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 introduces integration tests for retry logic (ITRetries.java) across both gRPC and HTTP/JSON clients, covering scenarios such as exponential backoff, no retry, non-retryable errors, multiple status codes, and timeouts. It also adds helper methods in TestClientInitializer.java to initialize SequenceServiceClient instances with custom retry settings. The review feedback suggests improving code readability by removing redundant fully qualified class names (like com.google.rpc.Code and java.time.Duration) since these classes are already imported.

@nnicolee

Copy link
Copy Markdown
Contributor Author

/gemini review

@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 introduces integration tests for retry logic in ITRetries.java using both gRPC and HTTP/JSON clients, alongside helper methods in TestClientInitializer.java to initialize these clients with custom retry settings. The review feedback focuses on ensuring exception-safe resource management during client setup and teardown in the test class to prevent potential resource leaks, as well as removing redundant @SuppressWarnings("deprecation") annotations from the test methods.

@nnicolee nnicolee changed the title test(showcase): add integration tests for retries test(showcase): Add gRPC and HttpJson Showcase ITs to verify Retries Jul 30, 2026
@nnicolee
nnicolee force-pushed the test/showcase-retries branch from b670b7d to c0cbe21 Compare July 31, 2026 16:49
@nnicolee
nnicolee enabled auto-merge (squash) August 4, 2026 15:17
@lqiu96
lqiu96 force-pushed the test/showcase-retries branch from 9f2da72 to 797d34d Compare August 27, 2026 16:01
@lqiu96 lqiu96 added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Aug 28, 2026
@nnicolee
nnicolee merged commit 1b28f13 into main Aug 28, 2026
200 of 201 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kokoro:force-run Add this label to force Kokoro to re-run the tests.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants