-
Notifications
You must be signed in to change notification settings - Fork 2.2k
FixFewTests-part2 #47933
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
FixFewTests-part2 #47933
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 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
- 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.
|
/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). |
- 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
|
/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). |
kushagraThapar
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, thanks @xinlian12
|
/check-enforcer override |
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).