[FaultInjection]addSupportForHeadCollectionRequest#47231
Merged
nehrao1 merged 9 commits intoNov 19, 2025
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR adds support for fault injection on head collection requests (barrier requests) and introduces a transport client interceptor mechanism to modify store responses at the direct layer for testing purposes.
Key Changes:
- Added
HEAD_COLLECTIONoperation type to fault injection framework for testing barrier requests - Introduced
ITransportClientInterceptorinterface and registration mechanism to allow modifying store responses in tests - Added
setGCLSNandsetHeaderValuemethods toStoreResponsefor test-driven header modification
Reviewed Changes
Copilot reviewed 21 out of 21 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| module-info.java | Exports interceptor package to test module |
| ITransportClientInterceptor.java | New interface defining transport client interceptor contract |
| TransportClient.java | Implements interceptor registration and applies interceptors to store responses |
| StoreResponse.java | Adds methods to modify response headers for testing |
| StoreClient.java | Delegates interceptor registration to replicated resource client |
| ServerStoreModel.java | Implements interceptor registration interface method |
| ReplicatedResourceClient.java | Delegates interceptor registration to transport client |
| BarrierRequestHelper.java | Copies fault injection context to barrier requests |
| RxStoreModel.java | Adds interceptor registration to interface |
| RxGatewayStoreModel.java | No-op implementation for gateway mode |
| RxDocumentClientImpl.java | Delegates interceptor registration to store model |
| ImplementationBridgeHelpers.java | Adds bridge method for interceptor registration |
| AsyncDocumentClient.java | Adds interceptor registration to interface |
| CosmosAsyncClient.java | Implements interceptor registration with bridge helper |
| FaultInjectionServerErrorRuleOnDirectTests.java | Adds comprehensive test for barrier request fault injection |
| CosmosTransportClientInterceptor.java | Test implementation of interceptor interface |
| CosmosInterceptorHelper.java | Test helper for registering interceptors |
| FaultInjectionRuleProcessor.java | Maps HEAD_COLLECTION to operation and resource types |
| FaultInjectionOperationType.java | Adds HEAD_COLLECTION operation type |
Contributor
API Change CheckAPIView identified API level changes in this PR and created the following API reviews |
jeet1995
approved these changes
Nov 11, 2025
nehrao1
approved these changes
Nov 13, 2025
Member
Author
|
/azp run java - cosmos - tests |
|
Azure Pipelines successfully started running 1 pipeline(s). |
Member
Author
|
/azp run java - cosmos - tests |
|
Azure Pipelines successfully started running 1 pipeline(s). |
Member
Author
|
/azp run java - cosmos - tests |
|
Azure Pipelines successfully started running 1 pipeline(s). |
Member
Author
|
/azp run java - cosmos - tests |
|
Azure Pipelines successfully started running 1 pipeline(s). |
nehrao1
approved these changes
Nov 18, 2025
jeet1995
added a commit
to jeet1995/azure-sdk-for-java
that referenced
this pull request
Apr 9, 2026
Replace raw AddressResolverGroup/doOnConnectedCallback fields threaded through CosmosClientBuilder -> ConnectionPolicy -> HttpClientConfig with a single IHttpClientInterceptor interface following the pattern from PR Azure#47231. Production (azure-cosmos): - IHttpClientInterceptor: minimal interface with getAddressResolverGroup() and getDoOnConnectedCallback(), null-safe in production - ConnectionPolicy: no longer exposes Netty types (AddressResolverGroup removed) - CosmosClientBuilder: holds IHttpClientInterceptor instead of raw Netty fields Test (azure-cosmos-test): - CosmosHttpClientInterceptor: concrete implementation - CosmosInterceptorHelper.registerHttpClientInterceptor(): convenience API consistent with existing registerTransportClientInterceptor() Tests updated to use CosmosInterceptorHelper instead of bridge helpers directly. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Closed
6 tasks
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.
Changes