-
Notifications
You must be signed in to change notification settings - Fork 2.1k
[FaultInjection]addSupportForHeadCollectionRequest #47231
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
[FaultInjection]addSupportForHeadCollectionRequest #47231
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 |
...e-cosmos/src/main/java/com/azure/cosmos/implementation/directconnectivity/StoreResponse.java
Show resolved
Hide resolved
...cosmos/src/main/java/com/azure/cosmos/implementation/directconnectivity/TransportClient.java
Outdated
Show resolved
Hide resolved
...rc/test/java/com/azure/cosmos/faultinjection/FaultInjectionServerErrorRuleOnDirectTests.java
Outdated
Show resolved
Hide resolved
API Change CheckAPIView identified API level changes in this PR and created the following API reviews |
|
/azp run java - cosmos - tests |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
/azp run java - cosmos - tests |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
/azp run java - cosmos - tests |
|
Azure Pipelines successfully started running 1 pipeline(s). |
FabianMeiswinkel
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM - Thx!
Changes