-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Expand file tree
/
Copy pathunacknowledged-client-bulkWrite.yml
More file actions
105 lines (98 loc) · 3.04 KB
/
unacknowledged-client-bulkWrite.yml
File metadata and controls
105 lines (98 loc) · 3.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
description: "unacknowledged-client-bulkWrite"
schemaVersion: "1.7"
runOnRequirements:
- minServerVersion: "8.0"
serverless: forbid
createEntities:
- client:
id: &client client
useMultipleMongoses: false
observeEvents:
- commandStartedEvent
- commandSucceededEvent
- commandFailedEvent
uriOptions:
w: 0
- database:
id: &database database
client: *client
databaseName: &databaseName command-monitoring-tests
- collection:
id: &collection collection
database: *database
collectionName: &collectionName test
initialData:
- collectionName: *collectionName
databaseName: *databaseName
documents:
- { _id: 1, x: 11 }
- { _id: 2, x: 22 }
- { _id: 3, x: 33 }
_yamlAnchors:
namespace: &namespace "command-monitoring-tests.test"
tests:
- description: 'A successful mixed client bulkWrite'
operations:
- object: *client
name: clientBulkWrite
arguments:
models:
- insertOne:
namespace: *namespace
document: { _id: 4, x: 44 }
- updateOne:
namespace: *namespace
filter: { _id: 3 }
update: { $set: { x: 333 } }
ordered: false
expectResult:
$$unsetOrMatches:
acknowledged: { $$unsetOrMatches: false }
insertedCount: { $$unsetOrMatches: 0 }
upsertedCount: { $$unsetOrMatches: 0 }
matchedCount: { $$unsetOrMatches: 0 }
modifiedCount: { $$unsetOrMatches: 0 }
deletedCount: { $$unsetOrMatches: 0 }
insertResults: { $$unsetOrMatches: {} }
updateResults: { $$unsetOrMatches: {} }
deleteResults: { $$unsetOrMatches: {} }
# Force completion of the w:0 write by executing a find on the same connection
- object: *collection
name: find
arguments:
filter: {}
expectResult:
- { _id: 1, x: 11 }
- { _id: 2, x: 22 }
- { _id: 3, x: 333 }
- { _id: 4, x: 44 }
expectEvents:
-
client: *client
ignoreExtraEvents: true
events:
- commandStartedEvent:
commandName: bulkWrite
databaseName: admin
command:
bulkWrite: 1
errorsOnly: true
ordered: false
ops:
- insert: 0
document: { _id: 4, x: 44 }
- update: 0
filter: { _id: 3 }
updateMods: { $set: { x: 333 } }
multi: false
nsInfo:
- ns: *namespace
- commandSucceededEvent:
commandName: bulkWrite
reply:
ok: 1
nInserted: { $$exists: false }
nMatched: { $$exists: false }
nModified: { $$exists: false }
nUpserted: { $$exists: false }
nDeleted: { $$exists: false }