Skip to content

Commit 729c269

Browse files
W-A-Jamesaditi-khare-mongoDB
authored andcommitted
test(NODE-4955): sync unacknowledged write spec tests (#4380)
1 parent 6629343 commit 729c269

File tree

8 files changed

+47
-41
lines changed

8 files changed

+47
-41
lines changed

test/spec/command-logging-and-monitoring/logging/command.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@
9393
"component": "command",
9494
"data": {
9595
"message": "Command succeeded",
96+
"databaseName": "logging-tests",
9697
"commandName": "ping",
9798
"reply": {
9899
"$$type": "string"
@@ -177,6 +178,7 @@
177178
"component": "command",
178179
"data": {
179180
"message": "Command failed",
181+
"databaseName": "logging-tests",
180182
"commandName": "find",
181183
"failure": {
182184
"$$exists": true

test/spec/command-logging-and-monitoring/logging/command.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,13 +52,14 @@ tests:
5252
component: command
5353
data:
5454
message: "Command succeeded"
55+
databaseName: *databaseName
5556
commandName: *commandName
5657
reply: { $$type: string }
5758
requestId: { $$type: [int, long] }
5859
serverHost: { $$type: string }
5960
serverPort: { $$type: [int, long] }
6061
durationMS: { $$type: [double, int, long] }
61-
62+
6263
- description: "A failed command"
6364
operations:
6465
- name: &commandName find
@@ -85,10 +86,10 @@ tests:
8586
component: command
8687
data:
8788
message: "Command failed"
89+
databaseName: *databaseName
8890
commandName: *commandName
8991
failure: { $$exists: true }
9092
requestId: { $$type: [int, long] }
9193
serverHost: { $$type: string }
9294
serverPort: { $$type: [int, long] }
9395
durationMS: { $$type: [double, int, long] }
94-

test/spec/command-logging-and-monitoring/monitoring/find.json

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"description": "find",
3-
"schemaVersion": "1.1",
3+
"schemaVersion": "1.15",
44
"createEntities": [
55
{
66
"client": {
@@ -103,7 +103,8 @@
103103
]
104104
}
105105
},
106-
"commandName": "find"
106+
"commandName": "find",
107+
"databaseName": "command-monitoring-tests"
107108
}
108109
}
109110
]
@@ -198,7 +199,8 @@
198199
]
199200
}
200201
},
201-
"commandName": "find"
202+
"commandName": "find",
203+
"databaseName": "command-monitoring-tests"
202204
}
203205
}
204206
]
@@ -262,7 +264,8 @@
262264
]
263265
}
264266
},
265-
"commandName": "find"
267+
"commandName": "find",
268+
"databaseName": "command-monitoring-tests"
266269
}
267270
}
268271
]
@@ -338,7 +341,8 @@
338341
]
339342
}
340343
},
341-
"commandName": "find"
344+
"commandName": "find",
345+
"databaseName": "command-monitoring-tests"
342346
}
343347
},
344348
{
@@ -376,7 +380,8 @@
376380
]
377381
}
378382
},
379-
"commandName": "getMore"
383+
"commandName": "getMore",
384+
"databaseName": "command-monitoring-tests"
380385
}
381386
}
382387
]
@@ -464,7 +469,8 @@
464469
]
465470
}
466471
},
467-
"commandName": "find"
472+
"commandName": "find",
473+
"databaseName": "command-monitoring-tests"
468474
}
469475
},
470476
{
@@ -498,7 +504,8 @@
498504
]
499505
}
500506
},
501-
"commandName": "getMore"
507+
"commandName": "getMore",
508+
"databaseName": "command-monitoring-tests"
502509
}
503510
}
504511
]
@@ -539,7 +546,8 @@
539546
},
540547
{
541548
"commandFailedEvent": {
542-
"commandName": "find"
549+
"commandName": "find",
550+
"databaseName": "command-monitoring-tests"
543551
}
544552
}
545553
]

test/spec/command-logging-and-monitoring/monitoring/find.yml

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

3-
schemaVersion: "1.1"
3+
schemaVersion: "1.15"
44

55
createEntities:
66
- client:
@@ -56,6 +56,7 @@ tests:
5656
firstBatch:
5757
- { _id: 1, x: 11 }
5858
commandName: find
59+
databaseName: *databaseName
5960

6061
- description: "A successful find with options"
6162
operations:
@@ -98,6 +99,7 @@ tests:
9899
- { x: 33 }
99100
- { x: 22 }
100101
commandName: find
102+
databaseName: *databaseName
101103

102104
- description: "A successful find with showRecordId and returnKey"
103105
operations:
@@ -131,6 +133,7 @@ tests:
131133
- { _id: 4 }
132134
- { _id: 5 }
133135
commandName: find
136+
databaseName: *databaseName
134137

135138
- description: "A successful find with a getMore"
136139
operations:
@@ -162,6 +165,7 @@ tests:
162165
- { _id: 2, x: 22 }
163166
- { _id: 3, x: 33 }
164167
commandName: find
168+
databaseName: *databaseName
165169
- commandStartedEvent:
166170
command:
167171
getMore: { $$type: [ int, long ] }
@@ -179,6 +183,7 @@ tests:
179183
- { _id: 4, x: 44 }
180184
- { _id: 5, x: 55 }
181185
commandName: getMore
186+
databaseName: *databaseName
182187

183188
- description: "A successful find event with a getmore and the server kills the cursor (<= 4.4)"
184189
runOnRequirements:
@@ -216,6 +221,7 @@ tests:
216221
- { _id: 2, x: 22 }
217222
- { _id: 3, x: 33 }
218223
commandName: find
224+
databaseName: *databaseName
219225
- commandStartedEvent:
220226
command:
221227
getMore: { $$type: [ int, long ] }
@@ -232,6 +238,7 @@ tests:
232238
nextBatch:
233239
- { _id: 4, x: 44 }
234240
commandName: getMore
241+
databaseName: *databaseName
235242

236243
- description: "A failed find event"
237244
operations:
@@ -252,3 +259,4 @@ tests:
252259
databaseName: *databaseName
253260
- commandFailedEvent:
254261
commandName: find
262+
databaseName: *databaseName

test/spec/command-logging-and-monitoring/monitoring/unacknowledgedBulkWrite.json

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -71,17 +71,7 @@
7171
"object": "collection",
7272
"arguments": {
7373
"filter": {}
74-
},
75-
"expectResult": [
76-
{
77-
"_id": 1,
78-
"x": 11
79-
},
80-
{
81-
"_id": "unorderedBulkWriteInsertW0",
82-
"x": 44
83-
}
84-
]
74+
}
8575
}
8676
],
8777
"expectEvents": [

test/spec/command-logging-and-monitoring/monitoring/unacknowledgedBulkWrite.yml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,6 @@ tests:
4242
object: *collection
4343
arguments:
4444
filter: { }
45-
expectResult: [
46-
{ _id: 1, x: 11 },
47-
{ _id: "unorderedBulkWriteInsertW0", x: 44 }
48-
]
4945
expectEvents:
5046
- client: *client
5147
ignoreExtraEvents: true

test/spec/command-logging-and-monitoring/monitoring/writeConcernError.json

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
{
22
"description": "writeConcernError",
3-
"schemaVersion": "1.13",
3+
"schemaVersion": "1.4",
44
"runOnRequirements": [
55
{
6-
"minServerVersion": "4.1.0",
6+
"minServerVersion": "4.3.1",
77
"topologies": [
88
"replicaset"
99
],
@@ -66,11 +66,11 @@
6666
"failCommands": [
6767
"insert"
6868
],
69+
"errorLabels": [
70+
"RetryableWriteError"
71+
],
6972
"writeConcernError": {
70-
"code": 91,
71-
"errorLabels": [
72-
"RetryableWriteError"
73-
]
73+
"code": 91
7474
}
7575
}
7676
}
@@ -112,11 +112,11 @@
112112
"reply": {
113113
"ok": 1,
114114
"n": 1,
115+
"errorLabels": [
116+
"RetryableWriteError"
117+
],
115118
"writeConcernError": {
116-
"code": 91,
117-
"errorLabels": [
118-
"RetryableWriteError"
119-
]
119+
"code": 91
120120
}
121121
},
122122
"commandName": "insert"

test/spec/command-logging-and-monitoring/monitoring/writeConcernError.yml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
description: "writeConcernError"
2-
schemaVersion: "1.13"
2+
schemaVersion: "1.4"
33
runOnRequirements:
44
-
5-
minServerVersion: 4.1.0
5+
minServerVersion: "4.3.1" # failCommand errorLabels option
66
topologies:
77
- replicaset
88
serverless: "forbid"
@@ -41,9 +41,9 @@ tests:
4141
mode: { times: 1 }
4242
data:
4343
failCommands: [ insert ]
44+
errorLabels: [ RetryableWriteError ]
4445
writeConcernError:
4546
code: 91 # ShutdownInProgress
46-
errorLabels: [RetryableWriteError]
4747
- name: insertOne
4848
object: *collection
4949
arguments:
@@ -63,7 +63,8 @@ tests:
6363
reply:
6464
ok: 1
6565
n: 1
66-
writeConcernError: { code: 91, errorLabels: [ "RetryableWriteError" ] }
66+
errorLabels: [ "RetryableWriteError" ]
67+
writeConcernError: { code: 91 }
6768
commandName: insert
6869
- commandStartedEvent:
6970
command:

0 commit comments

Comments
 (0)