test(showcase): add integration tests for retries - #13929
Conversation
… using SequenceService
There was a problem hiding this comment.
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.
…est/showcase-retries
…rviceSettings.Builder directly
|
/gemini review |
There was a problem hiding this comment.
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.
|
/gemini review |
There was a problem hiding this comment.
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.
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
TestClientInitializerfor creatingSequenceServiceClientinstances configured with custom retry parameters and disabled jitter.UNAVAILABLE->UNAVAILABLE->UNAVAILABLE->OK).maxAttempts = 1): Verifies that single-attempt settings abort immediately on the first error.INVALID_ARGUMENT) halt retries immediately even whenmaxAttempts > 1.UNAVAILABLE->RESOURCE_EXHAUSTED->DEADLINE_EXCEEDED->OK).rpcTimeout): Verifies that attempt timeouts cancel individual calls and trigger retries when server delay exceeds the attempt deadline.totalTimeout): Verifies that cumulative operation deadlines terminate the retry loop withDEADLINE_EXCEEDEDwhen total time expires.SequenceServicereport polled via Awaitility to verify attempt counts and status code sequences, removing local CPU context-switching scheduling lag as a source of test flakiness.