Skip to content

Commit bd9de56

Browse files
authored
add the new spec test (#2697)
1 parent 03dbe22 commit bd9de56

File tree

1 file changed

+80
-0
lines changed

1 file changed

+80
-0
lines changed
Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
description: "writeConcernError"
2+
schemaVersion: "1.13"
3+
runOnRequirements:
4+
-
5+
minServerVersion: 4.1.0
6+
topologies:
7+
- replicaset
8+
serverless: "forbid"
9+
10+
createEntities:
11+
- client:
12+
id: &client client
13+
observeEvents:
14+
- commandStartedEvent
15+
- commandSucceededEvent
16+
- commandFailedEvent
17+
- database:
18+
id: &database database
19+
client: *client
20+
databaseName: &databaseName command-monitoring-tests
21+
- collection:
22+
id: &collection collection
23+
database: *database
24+
collectionName: &collectionName test
25+
26+
initialData:
27+
- collectionName: *collectionName
28+
databaseName: *databaseName
29+
documents:
30+
- { _id: 1, x: 11 }
31+
32+
tests:
33+
- description: "A retryable write with write concern errors publishes success event"
34+
operations:
35+
- name: failPoint
36+
object: testRunner
37+
arguments:
38+
client: *client
39+
failPoint:
40+
configureFailPoint: failCommand
41+
mode: { times: 1 }
42+
data:
43+
failCommands: [ insert ]
44+
writeConcernError:
45+
code: 91 # ShutdownInProgress
46+
errorLabels: [RetryableWriteError]
47+
- name: insertOne
48+
object: *collection
49+
arguments:
50+
document: { _id: 2, x: 22 }
51+
expectEvents:
52+
- client: *client
53+
events:
54+
- commandStartedEvent:
55+
command:
56+
insert: *collectionName
57+
documents:
58+
- { _id: 2, x: 22 }
59+
ordered: true
60+
commandName: insert
61+
databaseName: *databaseName
62+
- commandSucceededEvent:
63+
reply:
64+
ok: 1
65+
n: 1
66+
writeConcernError: { code: 91, errorLabels: [ "RetryableWriteError" ] }
67+
commandName: insert
68+
- commandStartedEvent:
69+
command:
70+
insert: *collectionName
71+
documents:
72+
- { _id: 2, x: 22 }
73+
ordered: true
74+
commandName: insert
75+
databaseName: *databaseName
76+
- commandSucceededEvent:
77+
reply:
78+
ok: 1
79+
n: 1
80+
commandName: insert

0 commit comments

Comments
 (0)