Skip to content

Commit 43e673e

Browse files
committed
CSHARP-5120: Use single mongos in racy unacknowledged write tests.
1 parent f56d7d6 commit 43e673e

File tree

4 files changed

+62
-4
lines changed

4 files changed

+62
-4
lines changed

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

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
{
22
"description": "unacknowledged-write",
3-
"schemaVersion": "1.13",
3+
"schemaVersion": "1.16",
44
"createEntities": [
55
{
66
"client": {
77
"id": "client",
8+
"useMultipleMongoses": false,
89
"observeLogMessages": {
910
"command": "debug"
1011
}
@@ -53,11 +54,27 @@
5354
"_id": 2
5455
}
5556
}
57+
},
58+
{
59+
"name": "find",
60+
"object": "collection",
61+
"arguments": {
62+
"filter": {}
63+
},
64+
"expectResult": [
65+
{
66+
"_id": 1
67+
},
68+
{
69+
"_id": 2
70+
}
71+
]
5672
}
5773
],
5874
"expectLogMessages": [
5975
{
6076
"client": "client",
77+
"ignoreExtraMessages": true,
6178
"messages": [
6279
{
6380
"level": "debug",

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

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

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

55
createEntities:
66
- client:
77
id: &client client
8+
useMultipleMongoses: false
89
observeLogMessages:
910
command: debug
1011
- database:
@@ -31,8 +32,18 @@ tests:
3132
object: *collection
3233
arguments:
3334
document: { _id: 2 }
35+
# Force completion of the w: 0 write by executing a find on the same connection
36+
- name: find
37+
object: *collection
38+
arguments:
39+
filter: { }
40+
expectResult: [
41+
{ _id: 1 },
42+
{ _id: 2 }
43+
]
3444
expectLogMessages:
3545
- client: *client
46+
ignoreExtraMessages: true
3647
messages:
3748
- level: debug
3849
component: command

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

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
{
22
"description": "unacknowledgedBulkWrite",
3-
"schemaVersion": "1.0",
3+
"schemaVersion": "1.7",
44
"createEntities": [
55
{
66
"client": {
77
"id": "client",
8+
"useMultipleMongoses": false,
89
"observeEvents": [
910
"commandStartedEvent",
1011
"commandSucceededEvent",
@@ -64,11 +65,29 @@
6465
],
6566
"ordered": false
6667
}
68+
},
69+
{
70+
"name": "find",
71+
"object": "collection",
72+
"arguments": {
73+
"filter": {}
74+
},
75+
"expectResult": [
76+
{
77+
"_id": 1,
78+
"x": 11
79+
},
80+
{
81+
"_id": "unorderedBulkWriteInsertW0",
82+
"x": 44
83+
}
84+
]
6785
}
6886
],
6987
"expectEvents": [
7088
{
7189
"client": "client",
90+
"ignoreExtraEvents": true,
7291
"events": [
7392
{
7493
"commandStartedEvent": {

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

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

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

55
createEntities:
66
- client:
77
id: &client client
8+
useMultipleMongoses: false
89
observeEvents:
910
- commandStartedEvent
1011
- commandSucceededEvent
@@ -36,8 +37,18 @@ tests:
3637
- insertOne:
3738
document: { _id: "unorderedBulkWriteInsertW0", x: 44 }
3839
ordered: false
40+
# Force completion of the w: 0 write by executing a find on the same connection
41+
- name: find
42+
object: *collection
43+
arguments:
44+
filter: { }
45+
expectResult: [
46+
{ _id: 1, x: 11 },
47+
{ _id: "unorderedBulkWriteInsertW0", x: 44 }
48+
]
3949
expectEvents:
4050
- client: *client
51+
ignoreExtraEvents: true
4152
events:
4253
- commandStartedEvent:
4354
command:

0 commit comments

Comments
 (0)