Skip to content

Commit c6d685c

Browse files
committed
PHPLIB-1402: Convert retryable writes spec tests
Synced with mongodb/specifications@2c080e8
1 parent 10f18d7 commit c6d685c

29 files changed

+7919
-4
lines changed

tests/UnifiedSpecTests/retryable-writes/bulkWrite-errorLabels.json

Lines changed: 416 additions & 0 deletions
Large diffs are not rendered by default.

tests/UnifiedSpecTests/retryable-writes/bulkWrite-serverErrors.json

Lines changed: 85 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"description": "retryable-writes bulkWrite serverErrors",
3-
"schemaVersion": "1.0",
3+
"schemaVersion": "1.3",
44
"runOnRequirements": [
55
{
66
"minServerVersion": "4.0",
@@ -11,7 +11,8 @@
1111
{
1212
"minServerVersion": "4.1.7",
1313
"topologies": [
14-
"sharded"
14+
"sharded",
15+
"load-balanced"
1516
]
1617
}
1718
],
@@ -197,6 +198,88 @@
197198
]
198199
}
199200
]
201+
},
202+
{
203+
"description": "BulkWrite fails with a RetryableWriteError label after two connection failures",
204+
"operations": [
205+
{
206+
"name": "failPoint",
207+
"object": "testRunner",
208+
"arguments": {
209+
"client": "client0",
210+
"failPoint": {
211+
"configureFailPoint": "failCommand",
212+
"mode": {
213+
"times": 2
214+
},
215+
"data": {
216+
"failCommands": [
217+
"update"
218+
],
219+
"closeConnection": true
220+
}
221+
}
222+
}
223+
},
224+
{
225+
"object": "collection0",
226+
"name": "bulkWrite",
227+
"arguments": {
228+
"requests": [
229+
{
230+
"deleteOne": {
231+
"filter": {
232+
"_id": 1
233+
}
234+
}
235+
},
236+
{
237+
"insertOne": {
238+
"document": {
239+
"_id": 3,
240+
"x": 33
241+
}
242+
}
243+
},
244+
{
245+
"updateOne": {
246+
"filter": {
247+
"_id": 2
248+
},
249+
"update": {
250+
"$inc": {
251+
"x": 1
252+
}
253+
}
254+
}
255+
}
256+
],
257+
"ordered": true
258+
},
259+
"expectError": {
260+
"isError": true,
261+
"errorLabelsContain": [
262+
"RetryableWriteError"
263+
]
264+
}
265+
}
266+
],
267+
"outcome": [
268+
{
269+
"collectionName": "coll",
270+
"databaseName": "retryable-writes-tests",
271+
"documents": [
272+
{
273+
"_id": 2,
274+
"x": 22
275+
},
276+
{
277+
"_id": 3,
278+
"x": 33
279+
}
280+
]
281+
}
282+
]
200283
}
201284
]
202285
}

0 commit comments

Comments
 (0)