Skip to content

Commit

Permalink
DRIVERS-2877: Follow w: 0 write with a find in spec tests (#1560)
Browse files Browse the repository at this point in the history
This will force completion of the w: 0 write, which addresses
a TCP-based race condition in the tests
  • Loading branch information
jyemin committed Apr 3, 2024
1 parent fa9a05a commit cd08b72
Show file tree
Hide file tree
Showing 4 changed files with 58 additions and 4 deletions.

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
@@ -1,6 +1,6 @@
description: "unacknowledged-write"

schemaVersion: "1.13"
schemaVersion: "1.16"

createEntities:
- client:
Expand Down Expand Up @@ -31,8 +31,18 @@ tests:
object: *collection
arguments:
document: { _id: 2 }
# Force completion of the w: 0 write by executing a find on the same connection
- name: find
object: *collection
arguments:
filter: { }
expectResult: [
{ _id: 1 },
{ _id: 2 }
]
expectLogMessages:
- client: *client
ignoreExtraMessages: true
messages:
- level: debug
component: command
Expand Down

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
@@ -1,6 +1,6 @@
description: "unacknowledgedBulkWrite"

schemaVersion: "1.0"
schemaVersion: "1.7"

createEntities:
- client:
Expand Down Expand Up @@ -36,8 +36,18 @@ tests:
- insertOne:
document: { _id: "unorderedBulkWriteInsertW0", x: 44 }
ordered: false
# Force completion of the w: 0 write by executing a find on the same connection
- name: find
object: *collection
arguments:
filter: { }
expectResult: [
{ _id: 1, x: 11 },
{ _id: "unorderedBulkWriteInsertW0", x: 44 }
]
expectEvents:
- client: *client
ignoreExtraEvents: true
events:
- commandStartedEvent:
command:
Expand Down

0 comments on commit cd08b72

Please sign in to comment.