Skip to content

Commit cd08b72

Browse files
authored
DRIVERS-2877: Follow w: 0 write with a find in spec tests (#1560)
This will force completion of the w: 0 write, which addresses a TCP-based race condition in the tests
1 parent fa9a05a commit cd08b72

File tree

4 files changed

+58
-4
lines changed

4 files changed

+58
-4
lines changed

source/command-logging-and-monitoring/tests/logging/unacknowledged-write.json

Lines changed: 17 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

source/command-logging-and-monitoring/tests/logging/unacknowledged-write.yml

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
description: "unacknowledged-write"
22

3-
schemaVersion: "1.13"
3+
schemaVersion: "1.16"
44

55
createEntities:
66
- client:
@@ -31,8 +31,18 @@ tests:
3131
object: *collection
3232
arguments:
3333
document: { _id: 2 }
34+
# Force completion of the w: 0 write by executing a find on the same connection
35+
- name: find
36+
object: *collection
37+
arguments:
38+
filter: { }
39+
expectResult: [
40+
{ _id: 1 },
41+
{ _id: 2 }
42+
]
3443
expectLogMessages:
3544
- client: *client
45+
ignoreExtraMessages: true
3646
messages:
3747
- level: debug
3848
component: command

source/command-logging-and-monitoring/tests/monitoring/unacknowledgedBulkWrite.json

Lines changed: 19 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

source/command-logging-and-monitoring/tests/monitoring/unacknowledgedBulkWrite.yml

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
description: "unacknowledgedBulkWrite"
22

3-
schemaVersion: "1.0"
3+
schemaVersion: "1.7"
44

55
createEntities:
66
- client:
@@ -36,8 +36,18 @@ tests:
3636
- insertOne:
3737
document: { _id: "unorderedBulkWriteInsertW0", x: 44 }
3838
ordered: false
39+
# Force completion of the w: 0 write by executing a find on the same connection
40+
- name: find
41+
object: *collection
42+
arguments:
43+
filter: { }
44+
expectResult: [
45+
{ _id: 1, x: 11 },
46+
{ _id: "unorderedBulkWriteInsertW0", x: 44 }
47+
]
3948
expectEvents:
4049
- client: *client
50+
ignoreExtraEvents: true
4151
events:
4252
- commandStartedEvent:
4353
command:

0 commit comments

Comments
 (0)