Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates Cosmos DB test infrastructure to use bulk execution APIs for container cleanup/truncation and adjusts several change feed tests to use the updated bulk insert helper.
Changes:
- Switched test container cleanup/truncation from per-item deletes to
executeBulkOperations. - Refactored
bulkInsertinrx/TestSuiteBaseto use bulk operations and updated change feed tests to match the new signature. - Minor test and code cleanup (helper rename, redundant exception catch removal, whitespace-only diff).
Reviewed changes
Copilot reviewed 7 out of 8 changed files in this pull request and generated 11 comments.
Show a summary per file
| File | Description |
|---|---|
| sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/RxDocumentClientImpl.java | Whitespace-only diff in client initialization block. |
| sdk/cosmos/azure-cosmos-tests/src/test/java/com/azure/cosmos/rx/changefeed/pkversion/IncrementalChangeFeedProcessorTest.java | Updated calls to bulkInsert to match new helper signature. |
| sdk/cosmos/azure-cosmos-tests/src/test/java/com/azure/cosmos/rx/changefeed/epkversion/IncrementalChangeFeedProcessorTest.java | Updated calls to bulkInsert to match new helper signature. |
| sdk/cosmos/azure-cosmos-tests/src/test/java/com/azure/cosmos/rx/changefeed/epkversion/FullFidelityChangeFeedProcessorTest.java | Updated calls to bulkInsert to match new helper signature. |
| sdk/cosmos/azure-cosmos-tests/src/test/java/com/azure/cosmos/rx/TestSuiteBase.java | Reworked cleanup/truncation and bulk insert helpers to use bulk execution APIs. |
| sdk/cosmos/azure-cosmos-tests/src/test/java/com/azure/cosmos/rx/OrderbyDocumentQueryTest.java | Renamed a local helper method to avoid confusion with updated bulkInsert. |
| sdk/cosmos/azure-cosmos-tests/src/test/java/com/azure/cosmos/implementation/TestSuiteBase.java | Updated legacy (DocumentClient-based) truncation to delete documents via bulk execution. |
| sdk/cosmos/azure-cosmos-tests/src/test/java/com/azure/cosmos/CosmosDiagnosticsTest.java | Removed redundant JsonMappingException catch (covered by JsonProcessingException). |
sdk/cosmos/azure-cosmos-tests/src/test/java/com/azure/cosmos/rx/TestSuiteBase.java
Show resolved
Hide resolved
sdk/cosmos/azure-cosmos-tests/src/test/java/com/azure/cosmos/implementation/TestSuiteBase.java
Show resolved
Hide resolved
sdk/cosmos/azure-cosmos-tests/src/test/java/com/azure/cosmos/implementation/TestSuiteBase.java
Outdated
Show resolved
Hide resolved
sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/RxDocumentClientImpl.java
Show resolved
Hide resolved
sdk/cosmos/azure-cosmos-tests/src/test/java/com/azure/cosmos/rx/TestSuiteBase.java
Outdated
Show resolved
Hide resolved
sdk/cosmos/azure-cosmos-tests/src/test/java/com/azure/cosmos/rx/TestSuiteBase.java
Show resolved
Hide resolved
sdk/cosmos/azure-cosmos-tests/src/test/java/com/azure/cosmos/rx/TestSuiteBase.java
Outdated
Show resolved
Hide resolved
sdk/cosmos/azure-cosmos-tests/src/test/java/com/azure/cosmos/rx/TestSuiteBase.java
Show resolved
Hide resolved
sdk/cosmos/azure-cosmos-tests/src/test/java/com/azure/cosmos/rx/TestSuiteBase.java
Outdated
Show resolved
Hide resolved
sdk/cosmos/azure-cosmos-tests/src/test/java/com/azure/cosmos/rx/TestSuiteBase.java
Show resolved
Hide resolved
6 tasks
added 3 commits
February 6, 2026 13:09
- Add isSuccessStatusCode() validation for non-2xx bulk responses in all 3 sites (impl/TestSuiteBase truncateCollection, rx/TestSuiteBase cleanUpContainerInternal, rx/TestSuiteBase bulkInsert) - Keep 409/Conflict handling in bulkInsert but validate other non-2xx responses - Return server-created items from bulkInsertBlocking via getItem(clazz) - Use PartitionKey.NONE instead of new PartitionKey(null) in cleanUpContainerInternal
…agation Use BridgeInternal.createCosmosException() with status code and substatus code from CosmosBulkItemResponse instead of generic IllegalStateException.
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). |
- Add insertUsingPointOperations for one-by-one createItem path - Add bulkEnabled parameter to insertAllItemsBlocking/voidInsertAllItemsBlocking - Rename bulkInsertBlocking -> insertAllItemsBlocking - Rename voidBulkInsertBlocking -> voidInsertAllItemsBlocking - Update all callers with explicit bulkEnabled=true
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). |
kushagraThapar
approved these changes
Feb 9, 2026
Member
kushagraThapar
left a comment
There was a problem hiding this comment.
LGTM, thanks @xinlian12
Member
Author
|
/check-enforcer override |
jeet1995
pushed a commit
to jeet1995/azure-sdk-for-java
that referenced
this pull request
Feb 23, 2026
* fix few tests part 2 --------- Co-authored-by: Annie Liang <anniemac@Annies-MacBook-Pro.local>
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.
1. Test cleanup refactoring — bulk operations replace sequential deletes
The biggest change is in both TestSuiteBase classes (under rx/ and implementation/). The truncateCollection / cleanUpContainer methods are refactored to use Cosmos bulk operations (executeBulkOperations with CosmosBulkOperations.getDeleteItemOperation) instead of individual flatMap→deleteItem calls.
2. Bulk insert refactoring
The bulkInsert method is reworked to use the Cosmos bulk execution API (CosmosBulkOperations). A new insertAllItemsBlocking method is introduced, accepting a bulkEnabled parameter to choose between bulk and sequential insert.
3. Bulk insert concurrency reduced
DEFAULT_BULK_INSERT_CONCURRENCY_LEVEL dropped from 500 → 5, likely to reduce throttling in test environments.
4. Test call-site updates (20+ test files)
All test files that called truncateCollection or bulkInsertBlocking are updated to use the renamed methods (cleanUpContainer, insertAllItemsBlocking).