Skip to content

Commit 577c167

Browse files
committed
PYTHON-1546 - Update various spec tests and adjust runners
1 parent 022da1f commit 577c167

14 files changed

+285
-26
lines changed

test/command_monitoring/bulkWrite.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,15 +23,17 @@
2323
"arguments": {
2424
"requests": [
2525
{
26-
"insertOne": {
26+
"name": "insertOne",
27+
"arguments": {
2728
"document": {
2829
"_id": 4,
2930
"x": 44
3031
}
3132
}
3233
},
3334
{
34-
"updateOne": {
35+
"name": "updateOne",
36+
"arguments": {
3537
"filter": {
3638
"_id": 3
3739
},

test/command_monitoring/insertMany.json

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,9 @@
3232
"x": 22
3333
}
3434
],
35-
"ordered": true
35+
"options": {
36+
"ordered": true
37+
}
3638
},
3739
"command_name": "insert",
3840
"database_name": "command-monitoring-tests"
@@ -73,7 +75,9 @@
7375
"x": 11
7476
}
7577
],
76-
"ordered": true
78+
"options": {
79+
"ordered": true
80+
}
7781
},
7882
"command_name": "insert",
7983
"database_name": "command-monitoring-tests"
@@ -108,7 +112,9 @@
108112
"x": 22
109113
}
110114
],
111-
"ordered": false
115+
"options": {
116+
"ordered": false
117+
}
112118
}
113119
},
114120
"expectations": [
@@ -122,7 +128,9 @@
122128
"x": 22
123129
}
124130
],
125-
"ordered": false
131+
"options": {
132+
"ordered": false
133+
}
126134
},
127135
"command_name": "insert",
128136
"database_name": "command-monitoring-tests"

test/command_monitoring/unacknowledgedBulkWrite.json

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,20 +13,25 @@
1313
"comment": "On a 2.4 server, no GLE is sent and requires a client-side manufactured reply",
1414
"operation": {
1515
"name": "bulkWrite",
16+
"collectionOptions": {
17+
"writeConcern": {
18+
"w": 0
19+
}
20+
},
1621
"arguments": {
1722
"requests": [
1823
{
19-
"insertOne": {
24+
"name": "insertOne",
25+
"arguments": {
2026
"document": {
2127
"_id": "unorderedBulkWriteInsertW0",
2228
"x": 44
2329
}
2430
}
2531
}
2632
],
27-
"ordered": false,
28-
"writeConcern": {
29-
"w": 0
33+
"options": {
34+
"ordered": false
3035
}
3136
}
3237
},

test/retryable_writes/bulkWrite.json

Lines changed: 156 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@
99
"tests": [
1010
{
1111
"description": "First command is retried",
12+
"clientOptions": {
13+
"retryWrites": true
14+
},
1215
"failPoint": {
1316
"mode": {
1417
"times": 1
@@ -77,6 +80,9 @@
7780
},
7881
{
7982
"description": "All commands are retried",
83+
"clientOptions": {
84+
"retryWrites": true
85+
},
8086
"failPoint": {
8187
"mode": {
8288
"times": 7
@@ -206,6 +212,9 @@
206212
},
207213
{
208214
"description": "Both commands are retried after their first statement fails",
215+
"clientOptions": {
216+
"retryWrites": true
217+
},
209218
"failPoint": {
210219
"mode": {
211220
"times": 2
@@ -283,6 +292,9 @@
283292
},
284293
{
285294
"description": "Second command is retried after its second statement fails",
295+
"clientOptions": {
296+
"retryWrites": true
297+
},
286298
"failPoint": {
287299
"mode": {
288300
"skip": 2
@@ -360,6 +372,9 @@
360372
},
361373
{
362374
"description": "BulkWrite with unordered execution",
375+
"clientOptions": {
376+
"retryWrites": true
377+
},
363378
"failPoint": {
364379
"mode": {
365380
"times": 1
@@ -425,6 +440,9 @@
425440
},
426441
{
427442
"description": "First insertOne is never committed",
443+
"clientOptions": {
444+
"retryWrites": true
445+
},
428446
"failPoint": {
429447
"mode": {
430448
"times": 2
@@ -495,6 +513,9 @@
495513
},
496514
{
497515
"description": "Second updateOne is never committed",
516+
"clientOptions": {
517+
"retryWrites": true
518+
},
498519
"failPoint": {
499520
"mode": {
500521
"skip": 1
@@ -571,6 +592,9 @@
571592
},
572593
{
573594
"description": "Third updateOne is never committed",
595+
"clientOptions": {
596+
"retryWrites": true
597+
},
574598
"failPoint": {
575599
"mode": {
576600
"skip": 2
@@ -629,7 +653,138 @@
629653
"result": {
630654
"deletedCount": 0,
631655
"insertedIds": {
632-
"0": 2
656+
"1": 2
657+
},
658+
"matchedCount": 1,
659+
"modifiedCount": 1,
660+
"upsertedCount": 0,
661+
"upsertedIds": {}
662+
},
663+
"collection": {
664+
"data": [
665+
{
666+
"_id": 1,
667+
"x": 12
668+
},
669+
{
670+
"_id": 2,
671+
"x": 22
672+
}
673+
]
674+
}
675+
}
676+
},
677+
{
678+
"description": "Single-document write following deleteMany is retried",
679+
"clientOptions": {
680+
"retryWrites": true
681+
},
682+
"failPoint": {
683+
"mode": {
684+
"times": 1
685+
},
686+
"data": {
687+
"failBeforeCommitExceptionCode": 1
688+
}
689+
},
690+
"operation": {
691+
"name": "bulkWrite",
692+
"arguments": {
693+
"requests": [
694+
{
695+
"name": "deleteMany",
696+
"arguments": {
697+
"filter": {
698+
"x": 11
699+
}
700+
}
701+
},
702+
{
703+
"name": "insertOne",
704+
"arguments": {
705+
"document": {
706+
"_id": 2,
707+
"x": 22
708+
}
709+
}
710+
}
711+
],
712+
"options": {
713+
"ordered": true
714+
}
715+
}
716+
},
717+
"outcome": {
718+
"result": {
719+
"deletedCount": 1,
720+
"insertedIds": {
721+
"1": 2
722+
},
723+
"matchedCount": 0,
724+
"modifiedCount": 0,
725+
"upsertedCount": 0,
726+
"upsertedIds": {}
727+
},
728+
"collection": {
729+
"data": [
730+
{
731+
"_id": 2,
732+
"x": 22
733+
}
734+
]
735+
}
736+
}
737+
},
738+
{
739+
"description": "Single-document write following updateMany is retried",
740+
"clientOptions": {
741+
"retryWrites": true
742+
},
743+
"failPoint": {
744+
"mode": {
745+
"times": 1
746+
},
747+
"data": {
748+
"failBeforeCommitExceptionCode": 1
749+
}
750+
},
751+
"operation": {
752+
"name": "bulkWrite",
753+
"arguments": {
754+
"requests": [
755+
{
756+
"name": "updateMany",
757+
"arguments": {
758+
"filter": {
759+
"x": 11
760+
},
761+
"update": {
762+
"$inc": {
763+
"x": 1
764+
}
765+
}
766+
}
767+
},
768+
{
769+
"name": "insertOne",
770+
"arguments": {
771+
"document": {
772+
"_id": 2,
773+
"x": 22
774+
}
775+
}
776+
}
777+
],
778+
"options": {
779+
"ordered": true
780+
}
781+
}
782+
},
783+
"outcome": {
784+
"result": {
785+
"deletedCount": 0,
786+
"insertedIds": {
787+
"1": 2
633788
},
634789
"matchedCount": 1,
635790
"modifiedCount": 1,

test/retryable_writes/deleteOne.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@
1313
"tests": [
1414
{
1515
"description": "DeleteOne is committed on first attempt",
16+
"clientOptions": {
17+
"retryWrites": true
18+
},
1619
"failPoint": {
1720
"mode": {
1821
"times": 1
@@ -42,6 +45,9 @@
4245
},
4346
{
4447
"description": "DeleteOne is not committed on first attempt",
48+
"clientOptions": {
49+
"retryWrites": true
50+
},
4551
"failPoint": {
4652
"mode": {
4753
"times": 1
@@ -74,6 +80,9 @@
7480
},
7581
{
7682
"description": "DeleteOne is never committed",
83+
"clientOptions": {
84+
"retryWrites": true
85+
},
7786
"failPoint": {
7887
"mode": {
7988
"times": 2

test/retryable_writes/findOneAndDelete.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@
1313
"tests": [
1414
{
1515
"description": "FindOneAndDelete is committed on first attempt",
16+
"clientOptions": {
17+
"retryWrites": true
18+
},
1619
"failPoint": {
1720
"mode": {
1821
"times": 1
@@ -48,6 +51,9 @@
4851
},
4952
{
5053
"description": "FindOneAndDelete is not committed on first attempt",
54+
"clientOptions": {
55+
"retryWrites": true
56+
},
5157
"failPoint": {
5258
"mode": {
5359
"times": 1
@@ -86,6 +92,9 @@
8692
},
8793
{
8894
"description": "FindOneAndDelete is never committed",
95+
"clientOptions": {
96+
"retryWrites": true
97+
},
8998
"failPoint": {
9099
"mode": {
91100
"times": 2

0 commit comments

Comments
 (0)