Skip to content

DRIVERS-3184 assert unset partialResult in CRUD prose tests #1785

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

Merged
merged 5 commits into from
May 5, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 11 additions & 8 deletions source/crud/tests/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -168,8 +168,8 @@ InsertOne: {
```

Construct a list of write models (referred to as `models`) with `model` repeated `maxWriteBatchSize + 1` times. Execute
`bulkWrite` on `client` with `models`. Assert that the bulk write fails and returns a `BulkWriteError` (referred to as
`error`).
`bulkWrite` on `client` with `models`. Assert that the bulk write fails and returns a `BulkWriteException` (referred to
as `error`).

Assert that `error.writeConcernErrors` has a length of 2.

Expand Down Expand Up @@ -216,7 +216,7 @@ Construct a list of write models (referred to as `models`) with `model` repeated
Test that an unordered bulk write collects `WriteError`s across batches.

Execute `bulkWrite` on `client` with `models` and `ordered` set to false. Assert that the bulk write fails and returns a
`BulkWriteError` (referred to as `unorderedError`).
`BulkWriteException` (referred to as `unorderedError`).

Assert that `unorderedError.writeErrors` has a length of `maxWriteBatchSize + 1`.

Expand All @@ -227,7 +227,7 @@ Assert that two CommandStartedEvents were observed for the `bulkWrite` command.
Test that an ordered bulk write does not execute further batches when a `WriteError` occurs.

Execute `bulkWrite` on `client` with `models` and `ordered` set to true. Assert that the bulk write fails and returns a
`BulkWriteError` (referred to as `orderedError`).
`BulkWriteException` (referred to as `orderedError`).

Assert that `orderedError.writeErrors` has a length of 1.

Expand Down Expand Up @@ -356,7 +356,7 @@ UpdateOne {
```

Execute `bulkWrite` on `client` with `models` and `verboseResults` set to true. Assert that the bulk write fails and
returns a `BulkWriteError` (referred to as `bulkWriteError`).
returns a `BulkWriteException` (referred to as `bulkWriteError`).

Assert that `bulkWriteError.error` is populated with an error (referred to as `topLevelError`). Assert that
`topLevelError.errorCode` is equal to 8.
Expand Down Expand Up @@ -583,7 +583,8 @@ InsertOne {
```

Execute `bulkWrite` on `client` with `largeDocumentModel`. Assert that an error (referred to as `error`) is returned.
Assert that `error` is a client error.
Assert that `error` is a client error. If a `BulkWriteException` was thrown, assert `BulkWriteException.partialResult`
is unset.

#### Case 2: `namespace` too large

Expand All @@ -603,7 +604,8 @@ InsertOne {
```

Execute `bulkWrite` on `client` with `largeNamespaceModel`. Assert that an error (referred to as `error`) is returned.
Assert that `error` is a client error.
Assert that `error` is a client error. If a `BulkWriteException` was thrown, assert `BulkWriteException.partialResult`
is unset.

### 13. `MongoClient.bulkWrite` returns an error if auto-encryption is configured

Expand Down Expand Up @@ -637,7 +639,8 @@ InsertOne {
```

Execute `bulkWrite` on `client` with `model`. Assert that an error (referred to as `error`) is returned. Assert that
`error` is a client error containing the message: "bulkWrite does not currently support automatic encryption".
`error` is a client error containing the message: "bulkWrite does not currently support automatic encryption". If a
`BulkWriteException` was thrown, assert `BulkWriteException.partialResult` is unset.

### 14. `explain` helpers allow users to specify `maxTimeMS`

Expand Down
Loading