[Cosmos] Add compute error fault injection for address refresh - #50395
Open
Abhijeet Mohanty (jeet1995) wants to merge 1 commit into
Open
Abhijeet Mohanty (jeet1995) wants to merge 1 commit into
Abhijeet Mohanty (jeet1995) wants to merge 1 commit into
Conversation
|
Azure Pipelines: Successfully started running 2 pipeline(s). 33 pipeline(s) were filtered out due to trigger conditions. There may be pipelines that require an authorized user to comment /azp run to run. |
Member
Author
|
/azp run java - cosmos - tests |
|
Azure Pipelines: Successfully started running 1 pipeline(s). |
Abhijeet Mohanty (jeet1995)
marked this pull request as ready for review
September 10, 2026 14:18
Abhijeet Mohanty (jeet1995)
requested review from
a team and
Kiran Kumar Kolli (kirankumarkolli)
as code owners
September 10, 2026 14:18
Copilot started reviewing on behalf of
Abhijeet Mohanty (jeet1995)
September 10, 2026 14:18
View session
|
Azure Pipelines: Successfully started running 2 pipeline(s). 33 pipeline(s) were filtered out due to trigger conditions. There may be pipelines that require an authorized user to comment /azp run to run. |
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
The new unit test constructs RxDocumentServiceRequest using a non-existent create(...) overload, which will fail compilation.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
This PR extends the Cosmos fault-injection test infrastructure to model additional “compute” server failures during address refresh, and broadens both unit and E2E coverage to validate the new error mappings and PPCB failover/recovery behavior.
Changes:
- Added new fault-injection server error types
COMPUTE_SERVICE_UNAVAILABLE(503/0) andCOMPUTE_INTERNAL_SERVER_ERROR(500/102), including metadata address-refresh allowance. - Updated fault-injection server error construction to emit the expected status/substatus/header mapping for the new compute errors.
- Expanded unit/E2E tests to cover the new error types and verify they are surfaced in diagnostics and PPCB behavior.
File summaries
| File | Description |
|---|---|
| sdk/cosmos/azure-cosmos-tests/src/test/java/com/azure/cosmos/PerPartitionCircuitBreakerE2ETests.java | Parameterizes the PPCB address-refresh recovery test to run against response delay and the new compute error types; asserts diagnostics capture the injected failure. |
| sdk/cosmos/azure-cosmos-tests/src/test/java/com/azure/cosmos/faultinjection/FaultInjectionUnitTest.java | Extends metadata-operation validation and adds a data-driven unit test to verify status/substatus/header mappings. |
| sdk/cosmos/azure-cosmos-test/src/main/java/com/azure/cosmos/test/implementation/faultinjection/FaultInjectionServerErrorResultInternal.java | Implements injected exception/header mapping for the new compute error types. |
| sdk/cosmos/azure-cosmos-test/src/main/java/com/azure/cosmos/test/faultinjection/FaultInjectionServerErrorType.java | Adds new enum values for compute-originated server errors. |
| sdk/cosmos/azure-cosmos-test/src/main/java/com/azure/cosmos/test/faultinjection/FaultInjectionRuleBuilder.java | Allows compute error types specifically for METADATA_REQUEST_ADDRESS_REFRESH metadata fault-injection rules. |
| sdk/cosmos/azure-cosmos-test/CHANGELOG.md | Documents the added compute fault-injection error types and address-refresh support. |
Review details
- Files reviewed: 6/6 changed files
- Comments generated: 1
- Review effort level: Lite
💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
+137
to
+138
| RxDocumentServiceRequest request = RxDocumentServiceRequest.create( | ||
| null, OperationType.Read, "dbs/db/colls/coll", ResourceType.Address, Collections.emptyMap()); |
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.
Summary