Skip to content

Commit c1dc92c

Browse files
committed
PHPLIB-532: Sync spec tests for transactions
1 parent aec7136 commit c1dc92c

18 files changed

+799
-261
lines changed

tests/SpecTests/transactions-convenient-api/callback-retry.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,8 @@
235235
"errorLabelsOmit": [
236236
"TransientTransactionError",
237237
"UnknownTransactionCommitResult"
238-
]
238+
],
239+
"errorContains": "E11000"
239240
}
240241
}
241242
],

tests/SpecTests/transactions-convenient-api/commit-retry.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -304,6 +304,9 @@
304304
"commitTransaction"
305305
],
306306
"errorCode": 10107,
307+
"errorLabels": [
308+
"RetryableWriteError"
309+
],
307310
"closeConnection": false
308311
}
309312
},

tests/SpecTests/transactions-convenient-api/transaction-options.json

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@
192192
"session0": {
193193
"defaultTransactionOptions": {
194194
"readConcern": {
195-
"level": "snapshot"
195+
"level": "majority"
196196
},
197197
"writeConcern": {
198198
"w": 1
@@ -243,7 +243,7 @@
243243
"startTransaction": true,
244244
"autocommit": false,
245245
"readConcern": {
246-
"level": "snapshot"
246+
"level": "majority"
247247
},
248248
"writeConcern": null
249249
},
@@ -308,7 +308,7 @@
308308
},
309309
"options": {
310310
"readConcern": {
311-
"level": "snapshot"
311+
"level": "majority"
312312
},
313313
"writeConcern": {
314314
"w": 1
@@ -335,7 +335,7 @@
335335
"startTransaction": true,
336336
"autocommit": false,
337337
"readConcern": {
338-
"level": "snapshot"
338+
"level": "majority"
339339
},
340340
"writeConcern": null
341341
},
@@ -380,7 +380,7 @@
380380
"session0": {
381381
"defaultTransactionOptions": {
382382
"readConcern": {
383-
"level": "majority"
383+
"level": "snapshot"
384384
},
385385
"writeConcern": {
386386
"w": "majority"
@@ -412,7 +412,7 @@
412412
},
413413
"options": {
414414
"readConcern": {
415-
"level": "snapshot"
415+
"level": "majority"
416416
},
417417
"writeConcern": {
418418
"w": 1
@@ -439,7 +439,7 @@
439439
"startTransaction": true,
440440
"autocommit": false,
441441
"readConcern": {
442-
"level": "snapshot"
442+
"level": "majority"
443443
},
444444
"writeConcern": null
445445
},
@@ -481,7 +481,7 @@
481481
"description": "withTransaction explicit transaction options override client options",
482482
"useMultipleMongoses": true,
483483
"clientOptions": {
484-
"readConcernLevel": "majority",
484+
"readConcernLevel": "local",
485485
"w": "majority"
486486
},
487487
"operations": [
@@ -508,7 +508,7 @@
508508
},
509509
"options": {
510510
"readConcern": {
511-
"level": "snapshot"
511+
"level": "majority"
512512
},
513513
"writeConcern": {
514514
"w": 1
@@ -535,7 +535,7 @@
535535
"startTransaction": true,
536536
"autocommit": false,
537537
"readConcern": {
538-
"level": "snapshot"
538+
"level": "majority"
539539
},
540540
"writeConcern": null
541541
},

tests/SpecTests/transactions/abort.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -458,7 +458,8 @@
458458
"errorLabelsOmit": [
459459
"TransientTransactionError",
460460
"UnknownTransactionCommitResult"
461-
]
461+
],
462+
"errorContains": "E11000"
462463
}
463464
},
464465
{

tests/SpecTests/transactions/bulk.json

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -304,9 +304,7 @@
304304
"$set": {
305305
"x": 1
306306
}
307-
},
308-
"multi": false,
309-
"upsert": false
307+
}
310308
},
311309
{
312310
"q": {
@@ -317,7 +315,6 @@
317315
"x": 2
318316
}
319317
},
320-
"multi": false,
321318
"upsert": true
322319
}
323320
],
@@ -379,19 +376,15 @@
379376
},
380377
"u": {
381378
"y": 1
382-
},
383-
"multi": false,
384-
"upsert": false
379+
}
385380
},
386381
{
387382
"q": {
388383
"_id": 2
389384
},
390385
"u": {
391386
"y": 2
392-
},
393-
"multi": false,
394-
"upsert": false
387+
}
395388
}
396389
],
397390
"ordered": true,
@@ -454,8 +447,7 @@
454447
"z": 1
455448
}
456449
},
457-
"multi": true,
458-
"upsert": false
450+
"multi": true
459451
}
460452
],
461453
"ordered": true,

tests/SpecTests/transactions/causal-consistency.json

Lines changed: 6 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,7 @@
4040
"$inc": {
4141
"count": 1
4242
}
43-
},
44-
"upsert": false
43+
}
4544
},
4645
"result": {
4746
"matchedCount": 1,
@@ -65,8 +64,7 @@
6564
"$inc": {
6665
"count": 1
6766
}
68-
},
69-
"upsert": false
67+
}
7068
},
7169
"result": {
7270
"matchedCount": 1,
@@ -93,9 +91,7 @@
9391
"$inc": {
9492
"count": 1
9593
}
96-
},
97-
"multi": false,
98-
"upsert": false
94+
}
9995
}
10096
],
10197
"ordered": true,
@@ -123,9 +119,7 @@
123119
"$inc": {
124120
"count": 1
125121
}
126-
},
127-
"multi": false,
128-
"upsert": false
122+
}
129123
}
130124
],
131125
"ordered": true,
@@ -212,8 +206,7 @@
212206
"$inc": {
213207
"count": 1
214208
}
215-
},
216-
"upsert": false
209+
}
217210
},
218211
"result": {
219212
"matchedCount": 1,
@@ -260,9 +253,7 @@
260253
"$inc": {
261254
"count": 1
262255
}
263-
},
264-
"multi": false,
265-
"upsert": false
256+
}
266257
}
267258
],
268259
"ordered": true,

0 commit comments

Comments
 (0)