Repository navigation
DRIVERS-3684 Mandate reporting write concern errors #1998
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
Changes from 4 commits
805e260
4edc9f1
77517fa
0986943
010bf88
807f187
efe2358
b18748f
3f7eb0f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,67 @@ | ||
| description: write-concern-errors-aggregate | ||
|
|
||
| schemaVersion: "1.0" | ||
|
|
||
| createEntities: | ||
| - client: | ||
| id: &client0 client0 | ||
| useMultipleMongoses: false | ||
| - database: | ||
| id: &database0 database0 | ||
| client: *client0 | ||
| databaseName: &database_name write-concern-errors-tests | ||
| - collection: | ||
| id: &collection0 collection0 | ||
| database: *database0 | ||
| collectionName: &collection_name coll | ||
|
|
||
| initialData: | ||
|
kevinAlbs marked this conversation as resolved.
Resolved
|
||
| - collectionName: *collection_name | ||
| databaseName: *database_name | ||
| documents: | ||
| - { _id: 1, x: 11 } | ||
| - { _id: 2, x: 22 } | ||
|
|
||
| tests: | ||
| - description: aggregate with $out reports a writeConcernError | ||
| operations: | ||
| - name: failPoint | ||
| object: testRunner | ||
| arguments: | ||
| client: *client0 | ||
| failPoint: | ||
| configureFailPoint: failCommand | ||
| mode: { times: 1 } | ||
| data: | ||
| failCommands: [ aggregate ] | ||
| writeConcernError: &write_concern_error | ||
| code: 79 | ||
| codeName: UnknownReplWriteConcern | ||
| - name: aggregate | ||
| object: *collection0 | ||
| arguments: | ||
| pipeline: | ||
| - $match: { _id: { $gt: 1 } } | ||
| - $out: "aggregate_out" | ||
| expectError: &expect_write_concern_error | ||
| errorCode: 79 | ||
|
|
||
| - description: aggregate with $merge reports a writeConcernError | ||
| operations: | ||
| - name: failPoint | ||
| object: testRunner | ||
| arguments: | ||
| client: *client0 | ||
| failPoint: | ||
| configureFailPoint: failCommand | ||
| mode: { times: 1 } | ||
| data: | ||
| failCommands: [ aggregate ] | ||
| writeConcernError: *write_concern_error | ||
| - name: aggregate | ||
| object: *collection0 | ||
| arguments: | ||
| pipeline: | ||
| - $match: { _id: { $gt: 1 } } | ||
| - $merge: { into: "aggregate_merge" } | ||
| expectError: *expect_write_concern_error | ||
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,45 @@ | ||
| description: write-concern-errors-bulkWrite | ||
|
|
||
| schemaVersion: "1.0" | ||
|
|
||
| createEntities: | ||
| - client: | ||
| id: &client0 client0 | ||
| useMultipleMongoses: false | ||
| - database: | ||
| id: &database0 database0 | ||
| client: *client0 | ||
| databaseName: write-concern-errors-tests | ||
| - collection: | ||
| id: &collection0 collection0 | ||
| database: *database0 | ||
| collectionName: coll | ||
|
|
||
| initialData: | ||
| - databaseName: write-concern-errors-tests | ||
| collectionName: coll | ||
| documents: [] | ||
|
|
||
| tests: | ||
| - description: bulkWrite reports a writeConcernError | ||
| operations: | ||
| - name: failPoint | ||
| object: testRunner | ||
| arguments: | ||
| client: *client0 | ||
| failPoint: | ||
| configureFailPoint: failCommand | ||
| mode: { times: 1 } | ||
| data: | ||
| failCommands: [ insert ] | ||
| writeConcernError: | ||
| code: 79 | ||
| codeName: UnknownReplWriteConcern | ||
| - name: bulkWrite | ||
| object: *collection0 | ||
| arguments: | ||
| requests: | ||
| - insertOne: | ||
| document: { _id: 3, x: 33 } | ||
| expectError: | ||
| isError: true | ||
|
Comment on lines
+39
to
+40
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Note: the unified test runner spec doesn't currently support asserting on error codes for bulk errors. The purpose of these tests is to ensure that drivers aren't swallowing write concern errors, so it should be sufficient in these cases just to assert that an error was returned.
isabelatkinson marked this conversation as resolved.
Resolved
|
||
Uh oh!
There was an error while loading. Please reload this page.