1{
2 "description": "timeoutMS behaves correctly for retryable operations",
3 "schemaVersion": "1.9",
4 "runOnRequirements": [
5 {
6 "minServerVersion": "4.0",
7 "topologies": [
8 "replicaset"
9 ]
10 },
11 {
12 "minServerVersion": "4.2",
13 "topologies": [
14 "replicaset",
15 "sharded-replicaset"
16 ]
17 }
18 ],
19 "createEntities": [
20 {
21 "client": {
22 "id": "failPointClient",
23 "useMultipleMongoses": false
24 }
25 },
26 {
27 "client": {
28 "id": "client",
29 "uriOptions": {
30 "timeoutMS": 100
31 },
32 "useMultipleMongoses": false,
33 "observeEvents": [
34 "commandStartedEvent"
35 ],
36 "ignoreCommandMonitoringEvents": [
37 "killCursors"
38 ]
39 }
40 },
41 {
42 "database": {
43 "id": "database",
44 "client": "client",
45 "databaseName": "test"
46 }
47 },
48 {
49 "collection": {
50 "id": "collection",
51 "database": "database",
52 "collectionName": "coll"
53 }
54 }
55 ],
56 "initialData": [
57 {
58 "collectionName": "coll",
59 "databaseName": "test",
60 "documents": []
61 }
62 ],
63 "tests": [
64 {
65 "description": "timeoutMS applies to whole operation, not individual attempts - insertOne on collection",
66 "runOnRequirements": [
67 {
68 "minServerVersion": "4.4"
69 }
70 ],
71 "operations": [
72 {
73 "name": "failPoint",
74 "object": "testRunner",
75 "arguments": {
76 "client": "failPointClient",
77 "failPoint": {
78 "configureFailPoint": "failCommand",
79 "mode": {
80 "times": 4
81 },
82 "data": {
83 "failCommands": [
84 "insert"
85 ],
86 "blockConnection": true,
87 "blockTimeMS": 60,
88 "errorCode": 7,
89 "errorLabels": [
90 "RetryableWriteError"
91 ]
92 }
93 }
94 }
95 },
96 {
97 "name": "insertOne",
98 "object": "collection",
99 "arguments": {
100 "document": {
101 "x": 1
102 }
103 },
104 "expectError": {
105 "isTimeoutError": true
106 }
107 }
108 ]
109 },
110 {
111 "description": "operation is retried multiple times for non-zero timeoutMS - insertOne on collection",
112 "operations": [
113 {
114 "name": "failPoint",
115 "object": "testRunner",
116 "arguments": {
117 "client": "failPointClient",
118 "failPoint": {
119 "configureFailPoint": "failCommand",
120 "mode": {
121 "times": 2
122 },
123 "data": {
124 "failCommands": [
125 "insert"
126 ],
127 "errorCode": 7,
128 "closeConnection": false,
129 "errorLabels": [
130 "RetryableWriteError"
131 ]
132 }
133 }
134 }
135 },
136 {
137 "name": "insertOne",
138 "object": "collection",
139 "arguments": {
140 "timeoutMS": 500,
141 "document": {
142 "x": 1
143 }
144 }
145 }
146 ],
147 "expectEvents": [
148 {
149 "client": "client",
150 "events": [
151 {
152 "commandStartedEvent": {
153 "commandName": "insert",
154 "databaseName": "test",
155 "command": {
156 "insert": "coll",
157 "maxTimeMS": {
158 "$$type": [
159 "int",
160 "long"
161 ]
162 }
163 }
164 }
165 },
166 {
167 "commandStartedEvent": {
168 "commandName": "insert",
169 "databaseName": "test",
170 "command": {
171 "insert": "coll",
172 "maxTimeMS": {
173 "$$type": [
174 "int",
175 "long"
176 ]
177 }
178 }
179 }
180 },
181 {
182 "commandStartedEvent": {
183 "commandName": "insert",
184 "databaseName": "test",
185 "command": {
186 "insert": "coll",
187 "maxTimeMS": {
188 "$$type": [
189 "int",
190 "long"
191 ]
192 }
193 }
194 }
195 }
196 ]
197 }
198 ]
199 },
200 {
201 "description": "operation is retried multiple times if timeoutMS is zero - insertOne on collection",
202 "operations": [
203 {
204 "name": "failPoint",
205 "object": "testRunner",
206 "arguments": {
207 "client": "failPointClient",
208 "failPoint": {
209 "configureFailPoint": "failCommand",
210 "mode": {
211 "times": 2
212 },
213 "data": {
214 "failCommands": [
215 "insert"
216 ],
217 "errorCode": 7,
218 "closeConnection": false,
219 "errorLabels": [
220 "RetryableWriteError"
221 ]
222 }
223 }
224 }
225 },
226 {
227 "name": "insertOne",
228 "object": "collection",
229 "arguments": {
230 "timeoutMS": 0,
231 "document": {
232 "x": 1
233 }
234 }
235 }
236 ],
237 "expectEvents": [
238 {
239 "client": "client",
240 "events": [
241 {
242 "commandStartedEvent": {
243 "commandName": "insert",
244 "databaseName": "test",
245 "command": {
246 "insert": "coll",
247 "maxTimeMS": {
248 "$$exists": false
249 }
250 }
251 }
252 },
253 {
254 "commandStartedEvent": {
255 "commandName": "insert",
256 "databaseName": "test",
257 "command": {
258 "insert": "coll",
259 "maxTimeMS": {
260 "$$exists": false
261 }
262 }
263 }
264 },
265 {
266 "commandStartedEvent": {
267 "commandName": "insert",
268 "databaseName": "test",
269 "command": {
270 "insert": "coll",
271 "maxTimeMS": {
272 "$$exists": false
273 }
274 }
275 }
276 }
277 ]
278 }
279 ]
280 },
281 {
282 "description": "timeoutMS applies to whole operation, not individual attempts - insertMany on collection",
283 "runOnRequirements": [
284 {
285 "minServerVersion": "4.4"
286 }
287 ],
288 "operations": [
289 {
290 "name": "failPoint",
291 "object": "testRunner",
292 "arguments": {
293 "client": "failPointClient",
294 "failPoint": {
295 "configureFailPoint": "failCommand",
296 "mode": {
297 "times": 4
298 },
299 "data": {
300 "failCommands": [
301 "insert"
302 ],
303 "blockConnection": true,
304 "blockTimeMS": 60,
305 "errorCode": 7,
306 "errorLabels": [
307 "RetryableWriteError"
308 ]
309 }
310 }
311 }
312 },
313 {
314 "name": "insertMany",
315 "object": "collection",
316 "arguments": {
317 "documents": [
318 {
319 "x": 1
320 }
321 ]
322 },
323 "expectError": {
324 "isTimeoutError": true
325 }
326 }
327 ]
328 },
329 {
330 "description": "operation is retried multiple times for non-zero timeoutMS - insertMany on collection",
331 "operations": [
332 {
333 "name": "failPoint",
334 "object": "testRunner",
335 "arguments": {
336 "client": "failPointClient",
337 "failPoint": {
338 "configureFailPoint": "failCommand",
339 "mode": {
340 "times": 2
341 },
342 "data": {
343 "failCommands": [
344 "insert"
345 ],
346 "errorCode": 7,
347 "closeConnection": false,
348 "errorLabels": [
349 "RetryableWriteError"
350 ]
351 }
352 }
353 }
354 },
355 {
356 "name": "insertMany",
357 "object": "collection",
358 "arguments": {
359 "timeoutMS": 500,
360 "documents": [
361 {
362 "x": 1
363 }
364 ]
365 }
366 }
367 ],
368 "expectEvents": [
369 {
370 "client": "client",
371 "events": [
372 {
373 "commandStartedEvent": {
374 "commandName": "insert",
375 "databaseName": "test",
376 "command": {
377 "insert": "coll",
378 "maxTimeMS": {
379 "$$type": [
380 "int",
381 "long"
382 ]
383 }
384 }
385 }
386 },
387 {
388 "commandStartedEvent": {
389 "commandName": "insert",
390 "databaseName": "test",
391 "command": {
392 "insert": "coll",
393 "maxTimeMS": {
394 "$$type": [
395 "int",
396 "long"
397 ]
398 }
399 }
400 }
401 },
402 {
403 "commandStartedEvent": {
404 "commandName": "insert",
405 "databaseName": "test",
406 "command": {
407 "insert": "coll",
408 "maxTimeMS": {
409 "$$type": [
410 "int",
411 "long"
412 ]
413 }
414 }
415 }
416 }
417 ]
418 }
419 ]
420 },
421 {
422 "description": "operation is retried multiple times if timeoutMS is zero - insertMany on collection",
423 "operations": [
424 {
425 "name": "failPoint",
426 "object": "testRunner",
427 "arguments": {
428 "client": "failPointClient",
429 "failPoint": {
430 "configureFailPoint": "failCommand",
431 "mode": {
432 "times": 2
433 },
434 "data": {
435 "failCommands": [
436 "insert"
437 ],
438 "errorCode": 7,
439 "closeConnection": false,
440 "errorLabels": [
441 "RetryableWriteError"
442 ]
443 }
444 }
445 }
446 },
447 {
448 "name": "insertMany",
449 "object": "collection",
450 "arguments": {
451 "timeoutMS": 0,
452 "documents": [
453 {
454 "x": 1
455 }
456 ]
457 }
458 }
459 ],
460 "expectEvents": [
461 {
462 "client": "client",
463 "events": [
464 {
465 "commandStartedEvent": {
466 "commandName": "insert",
467 "databaseName": "test",
468 "command": {
469 "insert": "coll",
470 "maxTimeMS": {
471 "$$exists": false
472 }
473 }
474 }
475 },
476 {
477 "commandStartedEvent": {
478 "commandName": "insert",
479 "databaseName": "test",
480 "command": {
481 "insert": "coll",
482 "maxTimeMS": {
483 "$$exists": false
484 }
485 }
486 }
487 },
488 {
489 "commandStartedEvent": {
490 "commandName": "insert",
491 "databaseName": "test",
492 "command": {
493 "insert": "coll",
494 "maxTimeMS": {
495 "$$exists": false
496 }
497 }
498 }
499 }
500 ]
501 }
502 ]
503 },
504 {
505 "description": "timeoutMS applies to whole operation, not individual attempts - deleteOne on collection",
506 "runOnRequirements": [
507 {
508 "minServerVersion": "4.4"
509 }
510 ],
511 "operations": [
512 {
513 "name": "failPoint",
514 "object": "testRunner",
515 "arguments": {
516 "client": "failPointClient",
517 "failPoint": {
518 "configureFailPoint": "failCommand",
519 "mode": {
520 "times": 4
521 },
522 "data": {
523 "failCommands": [
524 "delete"
525 ],
526 "blockConnection": true,
527 "blockTimeMS": 60,
528 "errorCode": 7,
529 "errorLabels": [
530 "RetryableWriteError"
531 ]
532 }
533 }
534 }
535 },
536 {
537 "name": "deleteOne",
538 "object": "collection",
539 "arguments": {
540 "filter": {}
541 },
542 "expectError": {
543 "isTimeoutError": true
544 }
545 }
546 ]
547 },
548 {
549 "description": "operation is retried multiple times for non-zero timeoutMS - deleteOne on collection",
550 "operations": [
551 {
552 "name": "failPoint",
553 "object": "testRunner",
554 "arguments": {
555 "client": "failPointClient",
556 "failPoint": {
557 "configureFailPoint": "failCommand",
558 "mode": {
559 "times": 2
560 },
561 "data": {
562 "failCommands": [
563 "delete"
564 ],
565 "errorCode": 7,
566 "closeConnection": false,
567 "errorLabels": [
568 "RetryableWriteError"
569 ]
570 }
571 }
572 }
573 },
574 {
575 "name": "deleteOne",
576 "object": "collection",
577 "arguments": {
578 "timeoutMS": 500,
579 "filter": {}
580 }
581 }
582 ],
583 "expectEvents": [
584 {
585 "client": "client",
586 "events": [
587 {
588 "commandStartedEvent": {
589 "commandName": "delete",
590 "databaseName": "test",
591 "command": {
592 "delete": "coll",
593 "maxTimeMS": {
594 "$$type": [
595 "int",
596 "long"
597 ]
598 }
599 }
600 }
601 },
602 {
603 "commandStartedEvent": {
604 "commandName": "delete",
605 "databaseName": "test",
606 "command": {
607 "delete": "coll",
608 "maxTimeMS": {
609 "$$type": [
610 "int",
611 "long"
612 ]
613 }
614 }
615 }
616 },
617 {
618 "commandStartedEvent": {
619 "commandName": "delete",
620 "databaseName": "test",
621 "command": {
622 "delete": "coll",
623 "maxTimeMS": {
624 "$$type": [
625 "int",
626 "long"
627 ]
628 }
629 }
630 }
631 }
632 ]
633 }
634 ]
635 },
636 {
637 "description": "operation is retried multiple times if timeoutMS is zero - deleteOne on collection",
638 "operations": [
639 {
640 "name": "failPoint",
641 "object": "testRunner",
642 "arguments": {
643 "client": "failPointClient",
644 "failPoint": {
645 "configureFailPoint": "failCommand",
646 "mode": {
647 "times": 2
648 },
649 "data": {
650 "failCommands": [
651 "delete"
652 ],
653 "errorCode": 7,
654 "closeConnection": false,
655 "errorLabels": [
656 "RetryableWriteError"
657 ]
658 }
659 }
660 }
661 },
662 {
663 "name": "deleteOne",
664 "object": "collection",
665 "arguments": {
666 "timeoutMS": 0,
667 "filter": {}
668 }
669 }
670 ],
671 "expectEvents": [
672 {
673 "client": "client",
674 "events": [
675 {
676 "commandStartedEvent": {
677 "commandName": "delete",
678 "databaseName": "test",
679 "command": {
680 "delete": "coll",
681 "maxTimeMS": {
682 "$$exists": false
683 }
684 }
685 }
686 },
687 {
688 "commandStartedEvent": {
689 "commandName": "delete",
690 "databaseName": "test",
691 "command": {
692 "delete": "coll",
693 "maxTimeMS": {
694 "$$exists": false
695 }
696 }
697 }
698 },
699 {
700 "commandStartedEvent": {
701 "commandName": "delete",
702 "databaseName": "test",
703 "command": {
704 "delete": "coll",
705 "maxTimeMS": {
706 "$$exists": false
707 }
708 }
709 }
710 }
711 ]
712 }
713 ]
714 },
715 {
716 "description": "timeoutMS applies to whole operation, not individual attempts - replaceOne on collection",
717 "runOnRequirements": [
718 {
719 "minServerVersion": "4.4"
720 }
721 ],
722 "operations": [
723 {
724 "name": "failPoint",
725 "object": "testRunner",
726 "arguments": {
727 "client": "failPointClient",
728 "failPoint": {
729 "configureFailPoint": "failCommand",
730 "mode": {
731 "times": 4
732 },
733 "data": {
734 "failCommands": [
735 "update"
736 ],
737 "blockConnection": true,
738 "blockTimeMS": 60,
739 "errorCode": 7,
740 "errorLabels": [
741 "RetryableWriteError"
742 ]
743 }
744 }
745 }
746 },
747 {
748 "name": "replaceOne",
749 "object": "collection",
750 "arguments": {
751 "filter": {},
752 "replacement": {
753 "x": 1
754 }
755 },
756 "expectError": {
757 "isTimeoutError": true
758 }
759 }
760 ]
761 },
762 {
763 "description": "operation is retried multiple times for non-zero timeoutMS - replaceOne on collection",
764 "operations": [
765 {
766 "name": "failPoint",
767 "object": "testRunner",
768 "arguments": {
769 "client": "failPointClient",
770 "failPoint": {
771 "configureFailPoint": "failCommand",
772 "mode": {
773 "times": 2
774 },
775 "data": {
776 "failCommands": [
777 "update"
778 ],
779 "errorCode": 7,
780 "closeConnection": false,
781 "errorLabels": [
782 "RetryableWriteError"
783 ]
784 }
785 }
786 }
787 },
788 {
789 "name": "replaceOne",
790 "object": "collection",
791 "arguments": {
792 "timeoutMS": 500,
793 "filter": {},
794 "replacement": {
795 "x": 1
796 }
797 }
798 }
799 ],
800 "expectEvents": [
801 {
802 "client": "client",
803 "events": [
804 {
805 "commandStartedEvent": {
806 "commandName": "update",
807 "databaseName": "test",
808 "command": {
809 "update": "coll",
810 "maxTimeMS": {
811 "$$type": [
812 "int",
813 "long"
814 ]
815 }
816 }
817 }
818 },
819 {
820 "commandStartedEvent": {
821 "commandName": "update",
822 "databaseName": "test",
823 "command": {
824 "update": "coll",
825 "maxTimeMS": {
826 "$$type": [
827 "int",
828 "long"
829 ]
830 }
831 }
832 }
833 },
834 {
835 "commandStartedEvent": {
836 "commandName": "update",
837 "databaseName": "test",
838 "command": {
839 "update": "coll",
840 "maxTimeMS": {
841 "$$type": [
842 "int",
843 "long"
844 ]
845 }
846 }
847 }
848 }
849 ]
850 }
851 ]
852 },
853 {
854 "description": "operation is retried multiple times if timeoutMS is zero - replaceOne on collection",
855 "operations": [
856 {
857 "name": "failPoint",
858 "object": "testRunner",
859 "arguments": {
860 "client": "failPointClient",
861 "failPoint": {
862 "configureFailPoint": "failCommand",
863 "mode": {
864 "times": 2
865 },
866 "data": {
867 "failCommands": [
868 "update"
869 ],
870 "errorCode": 7,
871 "closeConnection": false,
872 "errorLabels": [
873 "RetryableWriteError"
874 ]
875 }
876 }
877 }
878 },
879 {
880 "name": "replaceOne",
881 "object": "collection",
882 "arguments": {
883 "timeoutMS": 0,
884 "filter": {},
885 "replacement": {
886 "x": 1
887 }
888 }
889 }
890 ],
891 "expectEvents": [
892 {
893 "client": "client",
894 "events": [
895 {
896 "commandStartedEvent": {
897 "commandName": "update",
898 "databaseName": "test",
899 "command": {
900 "update": "coll",
901 "maxTimeMS": {
902 "$$exists": false
903 }
904 }
905 }
906 },
907 {
908 "commandStartedEvent": {
909 "commandName": "update",
910 "databaseName": "test",
911 "command": {
912 "update": "coll",
913 "maxTimeMS": {
914 "$$exists": false
915 }
916 }
917 }
918 },
919 {
920 "commandStartedEvent": {
921 "commandName": "update",
922 "databaseName": "test",
923 "command": {
924 "update": "coll",
925 "maxTimeMS": {
926 "$$exists": false
927 }
928 }
929 }
930 }
931 ]
932 }
933 ]
934 },
935 {
936 "description": "timeoutMS applies to whole operation, not individual attempts - updateOne on collection",
937 "runOnRequirements": [
938 {
939 "minServerVersion": "4.4"
940 }
941 ],
942 "operations": [
943 {
944 "name": "failPoint",
945 "object": "testRunner",
946 "arguments": {
947 "client": "failPointClient",
948 "failPoint": {
949 "configureFailPoint": "failCommand",
950 "mode": {
951 "times": 4
952 },
953 "data": {
954 "failCommands": [
955 "update"
956 ],
957 "blockConnection": true,
958 "blockTimeMS": 60,
959 "errorCode": 7,
960 "errorLabels": [
961 "RetryableWriteError"
962 ]
963 }
964 }
965 }
966 },
967 {
968 "name": "updateOne",
969 "object": "collection",
970 "arguments": {
971 "filter": {},
972 "update": {
973 "$set": {
974 "x": 1
975 }
976 }
977 },
978 "expectError": {
979 "isTimeoutError": true
980 }
981 }
982 ]
983 },
984 {
985 "description": "operation is retried multiple times for non-zero timeoutMS - updateOne on collection",
986 "operations": [
987 {
988 "name": "failPoint",
989 "object": "testRunner",
990 "arguments": {
991 "client": "failPointClient",
992 "failPoint": {
993 "configureFailPoint": "failCommand",
994 "mode": {
995 "times": 2
996 },
997 "data": {
998 "failCommands": [
999 "update"
1000 ],
1001 "errorCode": 7,
1002 "closeConnection": false,
1003 "errorLabels": [
1004 "RetryableWriteError"
1005 ]
1006 }
1007 }
1008 }
1009 },
1010 {
1011 "name": "updateOne",
1012 "object": "collection",
1013 "arguments": {
1014 "timeoutMS": 500,
1015 "filter": {},
1016 "update": {
1017 "$set": {
1018 "x": 1
1019 }
1020 }
1021 }
1022 }
1023 ],
1024 "expectEvents": [
1025 {
1026 "client": "client",
1027 "events": [
1028 {
1029 "commandStartedEvent": {
1030 "commandName": "update",
1031 "databaseName": "test",
1032 "command": {
1033 "update": "coll",
1034 "maxTimeMS": {
1035 "$$type": [
1036 "int",
1037 "long"
1038 ]
1039 }
1040 }
1041 }
1042 },
1043 {
1044 "commandStartedEvent": {
1045 "commandName": "update",
1046 "databaseName": "test",
1047 "command": {
1048 "update": "coll",
1049 "maxTimeMS": {
1050 "$$type": [
1051 "int",
1052 "long"
1053 ]
1054 }
1055 }
1056 }
1057 },
1058 {
1059 "commandStartedEvent": {
1060 "commandName": "update",
1061 "databaseName": "test",
1062 "command": {
1063 "update": "coll",
1064 "maxTimeMS": {
1065 "$$type": [
1066 "int",
1067 "long"
1068 ]
1069 }
1070 }
1071 }
1072 }
1073 ]
1074 }
1075 ]
1076 },
1077 {
1078 "description": "operation is retried multiple times if timeoutMS is zero - updateOne on collection",
1079 "operations": [
1080 {
1081 "name": "failPoint",
1082 "object": "testRunner",
1083 "arguments": {
1084 "client": "failPointClient",
1085 "failPoint": {
1086 "configureFailPoint": "failCommand",
1087 "mode": {
1088 "times": 2
1089 },
1090 "data": {
1091 "failCommands": [
1092 "update"
1093 ],
1094 "errorCode": 7,
1095 "closeConnection": false,
1096 "errorLabels": [
1097 "RetryableWriteError"
1098 ]
1099 }
1100 }
1101 }
1102 },
1103 {
1104 "name": "updateOne",
1105 "object": "collection",
1106 "arguments": {
1107 "timeoutMS": 0,
1108 "filter": {},
1109 "update": {
1110 "$set": {
1111 "x": 1
1112 }
1113 }
1114 }
1115 }
1116 ],
1117 "expectEvents": [
1118 {
1119 "client": "client",
1120 "events": [
1121 {
1122 "commandStartedEvent": {
1123 "commandName": "update",
1124 "databaseName": "test",
1125 "command": {
1126 "update": "coll",
1127 "maxTimeMS": {
1128 "$$exists": false
1129 }
1130 }
1131 }
1132 },
1133 {
1134 "commandStartedEvent": {
1135 "commandName": "update",
1136 "databaseName": "test",
1137 "command": {
1138 "update": "coll",
1139 "maxTimeMS": {
1140 "$$exists": false
1141 }
1142 }
1143 }
1144 },
1145 {
1146 "commandStartedEvent": {
1147 "commandName": "update",
1148 "databaseName": "test",
1149 "command": {
1150 "update": "coll",
1151 "maxTimeMS": {
1152 "$$exists": false
1153 }
1154 }
1155 }
1156 }
1157 ]
1158 }
1159 ]
1160 },
1161 {
1162 "description": "timeoutMS applies to whole operation, not individual attempts - findOneAndDelete on collection",
1163 "runOnRequirements": [
1164 {
1165 "minServerVersion": "4.4"
1166 }
1167 ],
1168 "operations": [
1169 {
1170 "name": "failPoint",
1171 "object": "testRunner",
1172 "arguments": {
1173 "client": "failPointClient",
1174 "failPoint": {
1175 "configureFailPoint": "failCommand",
1176 "mode": {
1177 "times": 4
1178 },
1179 "data": {
1180 "failCommands": [
1181 "findAndModify"
1182 ],
1183 "blockConnection": true,
1184 "blockTimeMS": 60,
1185 "errorCode": 7,
1186 "errorLabels": [
1187 "RetryableWriteError"
1188 ]
1189 }
1190 }
1191 }
1192 },
1193 {
1194 "name": "findOneAndDelete",
1195 "object": "collection",
1196 "arguments": {
1197 "filter": {}
1198 },
1199 "expectError": {
1200 "isTimeoutError": true
1201 }
1202 }
1203 ]
1204 },
1205 {
1206 "description": "operation is retried multiple times for non-zero timeoutMS - findOneAndDelete on collection",
1207 "operations": [
1208 {
1209 "name": "failPoint",
1210 "object": "testRunner",
1211 "arguments": {
1212 "client": "failPointClient",
1213 "failPoint": {
1214 "configureFailPoint": "failCommand",
1215 "mode": {
1216 "times": 2
1217 },
1218 "data": {
1219 "failCommands": [
1220 "findAndModify"
1221 ],
1222 "errorCode": 7,
1223 "closeConnection": false,
1224 "errorLabels": [
1225 "RetryableWriteError"
1226 ]
1227 }
1228 }
1229 }
1230 },
1231 {
1232 "name": "findOneAndDelete",
1233 "object": "collection",
1234 "arguments": {
1235 "timeoutMS": 500,
1236 "filter": {}
1237 }
1238 }
1239 ],
1240 "expectEvents": [
1241 {
1242 "client": "client",
1243 "events": [
1244 {
1245 "commandStartedEvent": {
1246 "commandName": "findAndModify",
1247 "databaseName": "test",
1248 "command": {
1249 "findAndModify": "coll",
1250 "maxTimeMS": {
1251 "$$type": [
1252 "int",
1253 "long"
1254 ]
1255 }
1256 }
1257 }
1258 },
1259 {
1260 "commandStartedEvent": {
1261 "commandName": "findAndModify",
1262 "databaseName": "test",
1263 "command": {
1264 "findAndModify": "coll",
1265 "maxTimeMS": {
1266 "$$type": [
1267 "int",
1268 "long"
1269 ]
1270 }
1271 }
1272 }
1273 },
1274 {
1275 "commandStartedEvent": {
1276 "commandName": "findAndModify",
1277 "databaseName": "test",
1278 "command": {
1279 "findAndModify": "coll",
1280 "maxTimeMS": {
1281 "$$type": [
1282 "int",
1283 "long"
1284 ]
1285 }
1286 }
1287 }
1288 }
1289 ]
1290 }
1291 ]
1292 },
1293 {
1294 "description": "operation is retried multiple times if timeoutMS is zero - findOneAndDelete on collection",
1295 "operations": [
1296 {
1297 "name": "failPoint",
1298 "object": "testRunner",
1299 "arguments": {
1300 "client": "failPointClient",
1301 "failPoint": {
1302 "configureFailPoint": "failCommand",
1303 "mode": {
1304 "times": 2
1305 },
1306 "data": {
1307 "failCommands": [
1308 "findAndModify"
1309 ],
1310 "errorCode": 7,
1311 "closeConnection": false,
1312 "errorLabels": [
1313 "RetryableWriteError"
1314 ]
1315 }
1316 }
1317 }
1318 },
1319 {
1320 "name": "findOneAndDelete",
1321 "object": "collection",
1322 "arguments": {
1323 "timeoutMS": 0,
1324 "filter": {}
1325 }
1326 }
1327 ],
1328 "expectEvents": [
1329 {
1330 "client": "client",
1331 "events": [
1332 {
1333 "commandStartedEvent": {
1334 "commandName": "findAndModify",
1335 "databaseName": "test",
1336 "command": {
1337 "findAndModify": "coll",
1338 "maxTimeMS": {
1339 "$$exists": false
1340 }
1341 }
1342 }
1343 },
1344 {
1345 "commandStartedEvent": {
1346 "commandName": "findAndModify",
1347 "databaseName": "test",
1348 "command": {
1349 "findAndModify": "coll",
1350 "maxTimeMS": {
1351 "$$exists": false
1352 }
1353 }
1354 }
1355 },
1356 {
1357 "commandStartedEvent": {
1358 "commandName": "findAndModify",
1359 "databaseName": "test",
1360 "command": {
1361 "findAndModify": "coll",
1362 "maxTimeMS": {
1363 "$$exists": false
1364 }
1365 }
1366 }
1367 }
1368 ]
1369 }
1370 ]
1371 },
1372 {
1373 "description": "timeoutMS applies to whole operation, not individual attempts - findOneAndReplace on collection",
1374 "runOnRequirements": [
1375 {
1376 "minServerVersion": "4.4"
1377 }
1378 ],
1379 "operations": [
1380 {
1381 "name": "failPoint",
1382 "object": "testRunner",
1383 "arguments": {
1384 "client": "failPointClient",
1385 "failPoint": {
1386 "configureFailPoint": "failCommand",
1387 "mode": {
1388 "times": 4
1389 },
1390 "data": {
1391 "failCommands": [
1392 "findAndModify"
1393 ],
1394 "blockConnection": true,
1395 "blockTimeMS": 60,
1396 "errorCode": 7,
1397 "errorLabels": [
1398 "RetryableWriteError"
1399 ]
1400 }
1401 }
1402 }
1403 },
1404 {
1405 "name": "findOneAndReplace",
1406 "object": "collection",
1407 "arguments": {
1408 "filter": {},
1409 "replacement": {
1410 "x": 1
1411 }
1412 },
1413 "expectError": {
1414 "isTimeoutError": true
1415 }
1416 }
1417 ]
1418 },
1419 {
1420 "description": "operation is retried multiple times for non-zero timeoutMS - findOneAndReplace on collection",
1421 "operations": [
1422 {
1423 "name": "failPoint",
1424 "object": "testRunner",
1425 "arguments": {
1426 "client": "failPointClient",
1427 "failPoint": {
1428 "configureFailPoint": "failCommand",
1429 "mode": {
1430 "times": 2
1431 },
1432 "data": {
1433 "failCommands": [
1434 "findAndModify"
1435 ],
1436 "errorCode": 7,
1437 "closeConnection": false,
1438 "errorLabels": [
1439 "RetryableWriteError"
1440 ]
1441 }
1442 }
1443 }
1444 },
1445 {
1446 "name": "findOneAndReplace",
1447 "object": "collection",
1448 "arguments": {
1449 "timeoutMS": 500,
1450 "filter": {},
1451 "replacement": {
1452 "x": 1
1453 }
1454 }
1455 }
1456 ],
1457 "expectEvents": [
1458 {
1459 "client": "client",
1460 "events": [
1461 {
1462 "commandStartedEvent": {
1463 "commandName": "findAndModify",
1464 "databaseName": "test",
1465 "command": {
1466 "findAndModify": "coll",
1467 "maxTimeMS": {
1468 "$$type": [
1469 "int",
1470 "long"
1471 ]
1472 }
1473 }
1474 }
1475 },
1476 {
1477 "commandStartedEvent": {
1478 "commandName": "findAndModify",
1479 "databaseName": "test",
1480 "command": {
1481 "findAndModify": "coll",
1482 "maxTimeMS": {
1483 "$$type": [
1484 "int",
1485 "long"
1486 ]
1487 }
1488 }
1489 }
1490 },
1491 {
1492 "commandStartedEvent": {
1493 "commandName": "findAndModify",
1494 "databaseName": "test",
1495 "command": {
1496 "findAndModify": "coll",
1497 "maxTimeMS": {
1498 "$$type": [
1499 "int",
1500 "long"
1501 ]
1502 }
1503 }
1504 }
1505 }
1506 ]
1507 }
1508 ]
1509 },
1510 {
1511 "description": "operation is retried multiple times if timeoutMS is zero - findOneAndReplace on collection",
1512 "operations": [
1513 {
1514 "name": "failPoint",
1515 "object": "testRunner",
1516 "arguments": {
1517 "client": "failPointClient",
1518 "failPoint": {
1519 "configureFailPoint": "failCommand",
1520 "mode": {
1521 "times": 2
1522 },
1523 "data": {
1524 "failCommands": [
1525 "findAndModify"
1526 ],
1527 "errorCode": 7,
1528 "closeConnection": false,
1529 "errorLabels": [
1530 "RetryableWriteError"
1531 ]
1532 }
1533 }
1534 }
1535 },
1536 {
1537 "name": "findOneAndReplace",
1538 "object": "collection",
1539 "arguments": {
1540 "timeoutMS": 0,
1541 "filter": {},
1542 "replacement": {
1543 "x": 1
1544 }
1545 }
1546 }
1547 ],
1548 "expectEvents": [
1549 {
1550 "client": "client",
1551 "events": [
1552 {
1553 "commandStartedEvent": {
1554 "commandName": "findAndModify",
1555 "databaseName": "test",
1556 "command": {
1557 "findAndModify": "coll",
1558 "maxTimeMS": {
1559 "$$exists": false
1560 }
1561 }
1562 }
1563 },
1564 {
1565 "commandStartedEvent": {
1566 "commandName": "findAndModify",
1567 "databaseName": "test",
1568 "command": {
1569 "findAndModify": "coll",
1570 "maxTimeMS": {
1571 "$$exists": false
1572 }
1573 }
1574 }
1575 },
1576 {
1577 "commandStartedEvent": {
1578 "commandName": "findAndModify",
1579 "databaseName": "test",
1580 "command": {
1581 "findAndModify": "coll",
1582 "maxTimeMS": {
1583 "$$exists": false
1584 }
1585 }
1586 }
1587 }
1588 ]
1589 }
1590 ]
1591 },
1592 {
1593 "description": "timeoutMS applies to whole operation, not individual attempts - findOneAndUpdate on collection",
1594 "runOnRequirements": [
1595 {
1596 "minServerVersion": "4.4"
1597 }
1598 ],
1599 "operations": [
1600 {
1601 "name": "failPoint",
1602 "object": "testRunner",
1603 "arguments": {
1604 "client": "failPointClient",
1605 "failPoint": {
1606 "configureFailPoint": "failCommand",
1607 "mode": {
1608 "times": 4
1609 },
1610 "data": {
1611 "failCommands": [
1612 "findAndModify"
1613 ],
1614 "blockConnection": true,
1615 "blockTimeMS": 60,
1616 "errorCode": 7,
1617 "errorLabels": [
1618 "RetryableWriteError"
1619 ]
1620 }
1621 }
1622 }
1623 },
1624 {
1625 "name": "findOneAndUpdate",
1626 "object": "collection",
1627 "arguments": {
1628 "filter": {},
1629 "update": {
1630 "$set": {
1631 "x": 1
1632 }
1633 }
1634 },
1635 "expectError": {
1636 "isTimeoutError": true
1637 }
1638 }
1639 ]
1640 },
1641 {
1642 "description": "operation is retried multiple times for non-zero timeoutMS - findOneAndUpdate on collection",
1643 "operations": [
1644 {
1645 "name": "failPoint",
1646 "object": "testRunner",
1647 "arguments": {
1648 "client": "failPointClient",
1649 "failPoint": {
1650 "configureFailPoint": "failCommand",
1651 "mode": {
1652 "times": 2
1653 },
1654 "data": {
1655 "failCommands": [
1656 "findAndModify"
1657 ],
1658 "errorCode": 7,
1659 "closeConnection": false,
1660 "errorLabels": [
1661 "RetryableWriteError"
1662 ]
1663 }
1664 }
1665 }
1666 },
1667 {
1668 "name": "findOneAndUpdate",
1669 "object": "collection",
1670 "arguments": {
1671 "timeoutMS": 500,
1672 "filter": {},
1673 "update": {
1674 "$set": {
1675 "x": 1
1676 }
1677 }
1678 }
1679 }
1680 ],
1681 "expectEvents": [
1682 {
1683 "client": "client",
1684 "events": [
1685 {
1686 "commandStartedEvent": {
1687 "commandName": "findAndModify",
1688 "databaseName": "test",
1689 "command": {
1690 "findAndModify": "coll",
1691 "maxTimeMS": {
1692 "$$type": [
1693 "int",
1694 "long"
1695 ]
1696 }
1697 }
1698 }
1699 },
1700 {
1701 "commandStartedEvent": {
1702 "commandName": "findAndModify",
1703 "databaseName": "test",
1704 "command": {
1705 "findAndModify": "coll",
1706 "maxTimeMS": {
1707 "$$type": [
1708 "int",
1709 "long"
1710 ]
1711 }
1712 }
1713 }
1714 },
1715 {
1716 "commandStartedEvent": {
1717 "commandName": "findAndModify",
1718 "databaseName": "test",
1719 "command": {
1720 "findAndModify": "coll",
1721 "maxTimeMS": {
1722 "$$type": [
1723 "int",
1724 "long"
1725 ]
1726 }
1727 }
1728 }
1729 }
1730 ]
1731 }
1732 ]
1733 },
1734 {
1735 "description": "operation is retried multiple times if timeoutMS is zero - findOneAndUpdate on collection",
1736 "operations": [
1737 {
1738 "name": "failPoint",
1739 "object": "testRunner",
1740 "arguments": {
1741 "client": "failPointClient",
1742 "failPoint": {
1743 "configureFailPoint": "failCommand",
1744 "mode": {
1745 "times": 2
1746 },
1747 "data": {
1748 "failCommands": [
1749 "findAndModify"
1750 ],
1751 "errorCode": 7,
1752 "closeConnection": false,
1753 "errorLabels": [
1754 "RetryableWriteError"
1755 ]
1756 }
1757 }
1758 }
1759 },
1760 {
1761 "name": "findOneAndUpdate",
1762 "object": "collection",
1763 "arguments": {
1764 "timeoutMS": 0,
1765 "filter": {},
1766 "update": {
1767 "$set": {
1768 "x": 1
1769 }
1770 }
1771 }
1772 }
1773 ],
1774 "expectEvents": [
1775 {
1776 "client": "client",
1777 "events": [
1778 {
1779 "commandStartedEvent": {
1780 "commandName": "findAndModify",
1781 "databaseName": "test",
1782 "command": {
1783 "findAndModify": "coll",
1784 "maxTimeMS": {
1785 "$$exists": false
1786 }
1787 }
1788 }
1789 },
1790 {
1791 "commandStartedEvent": {
1792 "commandName": "findAndModify",
1793 "databaseName": "test",
1794 "command": {
1795 "findAndModify": "coll",
1796 "maxTimeMS": {
1797 "$$exists": false
1798 }
1799 }
1800 }
1801 },
1802 {
1803 "commandStartedEvent": {
1804 "commandName": "findAndModify",
1805 "databaseName": "test",
1806 "command": {
1807 "findAndModify": "coll",
1808 "maxTimeMS": {
1809 "$$exists": false
1810 }
1811 }
1812 }
1813 }
1814 ]
1815 }
1816 ]
1817 },
1818 {
1819 "description": "timeoutMS applies to whole operation, not individual attempts - bulkWrite on collection",
1820 "runOnRequirements": [
1821 {
1822 "minServerVersion": "4.4"
1823 }
1824 ],
1825 "operations": [
1826 {
1827 "name": "failPoint",
1828 "object": "testRunner",
1829 "arguments": {
1830 "client": "failPointClient",
1831 "failPoint": {
1832 "configureFailPoint": "failCommand",
1833 "mode": {
1834 "times": 4
1835 },
1836 "data": {
1837 "failCommands": [
1838 "insert"
1839 ],
1840 "blockConnection": true,
1841 "blockTimeMS": 60,
1842 "errorCode": 7,
1843 "errorLabels": [
1844 "RetryableWriteError"
1845 ]
1846 }
1847 }
1848 }
1849 },
1850 {
1851 "name": "bulkWrite",
1852 "object": "collection",
1853 "arguments": {
1854 "requests": [
1855 {
1856 "insertOne": {
1857 "document": {
1858 "_id": 1
1859 }
1860 }
1861 }
1862 ]
1863 },
1864 "expectError": {
1865 "isTimeoutError": true
1866 }
1867 }
1868 ]
1869 },
1870 {
1871 "description": "operation is retried multiple times for non-zero timeoutMS - bulkWrite on collection",
1872 "operations": [
1873 {
1874 "name": "failPoint",
1875 "object": "testRunner",
1876 "arguments": {
1877 "client": "failPointClient",
1878 "failPoint": {
1879 "configureFailPoint": "failCommand",
1880 "mode": {
1881 "times": 2
1882 },
1883 "data": {
1884 "failCommands": [
1885 "insert"
1886 ],
1887 "errorCode": 7,
1888 "closeConnection": false,
1889 "errorLabels": [
1890 "RetryableWriteError"
1891 ]
1892 }
1893 }
1894 }
1895 },
1896 {
1897 "name": "bulkWrite",
1898 "object": "collection",
1899 "arguments": {
1900 "timeoutMS": 500,
1901 "requests": [
1902 {
1903 "insertOne": {
1904 "document": {
1905 "_id": 1
1906 }
1907 }
1908 }
1909 ]
1910 }
1911 }
1912 ],
1913 "expectEvents": [
1914 {
1915 "client": "client",
1916 "events": [
1917 {
1918 "commandStartedEvent": {
1919 "commandName": "insert",
1920 "databaseName": "test",
1921 "command": {
1922 "insert": "coll",
1923 "maxTimeMS": {
1924 "$$type": [
1925 "int",
1926 "long"
1927 ]
1928 }
1929 }
1930 }
1931 },
1932 {
1933 "commandStartedEvent": {
1934 "commandName": "insert",
1935 "databaseName": "test",
1936 "command": {
1937 "insert": "coll",
1938 "maxTimeMS": {
1939 "$$type": [
1940 "int",
1941 "long"
1942 ]
1943 }
1944 }
1945 }
1946 },
1947 {
1948 "commandStartedEvent": {
1949 "commandName": "insert",
1950 "databaseName": "test",
1951 "command": {
1952 "insert": "coll",
1953 "maxTimeMS": {
1954 "$$type": [
1955 "int",
1956 "long"
1957 ]
1958 }
1959 }
1960 }
1961 }
1962 ]
1963 }
1964 ]
1965 },
1966 {
1967 "description": "operation is retried multiple times if timeoutMS is zero - bulkWrite on collection",
1968 "operations": [
1969 {
1970 "name": "failPoint",
1971 "object": "testRunner",
1972 "arguments": {
1973 "client": "failPointClient",
1974 "failPoint": {
1975 "configureFailPoint": "failCommand",
1976 "mode": {
1977 "times": 2
1978 },
1979 "data": {
1980 "failCommands": [
1981 "insert"
1982 ],
1983 "errorCode": 7,
1984 "closeConnection": false,
1985 "errorLabels": [
1986 "RetryableWriteError"
1987 ]
1988 }
1989 }
1990 }
1991 },
1992 {
1993 "name": "bulkWrite",
1994 "object": "collection",
1995 "arguments": {
1996 "timeoutMS": 0,
1997 "requests": [
1998 {
1999 "insertOne": {
2000 "document": {
2001 "_id": 1
2002 }
2003 }
2004 }
2005 ]
2006 }
2007 }
2008 ],
2009 "expectEvents": [
2010 {
2011 "client": "client",
2012 "events": [
2013 {
2014 "commandStartedEvent": {
2015 "commandName": "insert",
2016 "databaseName": "test",
2017 "command": {
2018 "insert": "coll",
2019 "maxTimeMS": {
2020 "$$exists": false
2021 }
2022 }
2023 }
2024 },
2025 {
2026 "commandStartedEvent": {
2027 "commandName": "insert",
2028 "databaseName": "test",
2029 "command": {
2030 "insert": "coll",
2031 "maxTimeMS": {
2032 "$$exists": false
2033 }
2034 }
2035 }
2036 },
2037 {
2038 "commandStartedEvent": {
2039 "commandName": "insert",
2040 "databaseName": "test",
2041 "command": {
2042 "insert": "coll",
2043 "maxTimeMS": {
2044 "$$exists": false
2045 }
2046 }
2047 }
2048 }
2049 ]
2050 }
2051 ]
2052 },
2053 {
2054 "description": "timeoutMS applies to whole operation, not individual attempts - listDatabases on client",
2055 "runOnRequirements": [
2056 {
2057 "minServerVersion": "4.4"
2058 }
2059 ],
2060 "operations": [
2061 {
2062 "name": "failPoint",
2063 "object": "testRunner",
2064 "arguments": {
2065 "client": "failPointClient",
2066 "failPoint": {
2067 "configureFailPoint": "failCommand",
2068 "mode": {
2069 "times": 4
2070 },
2071 "data": {
2072 "failCommands": [
2073 "listDatabases"
2074 ],
2075 "blockConnection": true,
2076 "blockTimeMS": 60,
2077 "errorCode": 7,
2078 "errorLabels": [
2079 "RetryableWriteError"
2080 ]
2081 }
2082 }
2083 }
2084 },
2085 {
2086 "name": "listDatabases",
2087 "object": "client",
2088 "arguments": {
2089 "filter": {}
2090 },
2091 "expectError": {
2092 "isTimeoutError": true
2093 }
2094 }
2095 ]
2096 },
2097 {
2098 "description": "operation is retried multiple times for non-zero timeoutMS - listDatabases on client",
2099 "operations": [
2100 {
2101 "name": "failPoint",
2102 "object": "testRunner",
2103 "arguments": {
2104 "client": "failPointClient",
2105 "failPoint": {
2106 "configureFailPoint": "failCommand",
2107 "mode": {
2108 "times": 2
2109 },
2110 "data": {
2111 "failCommands": [
2112 "listDatabases"
2113 ],
2114 "errorCode": 7,
2115 "closeConnection": false,
2116 "errorLabels": [
2117 "RetryableWriteError"
2118 ]
2119 }
2120 }
2121 }
2122 },
2123 {
2124 "name": "listDatabases",
2125 "object": "client",
2126 "arguments": {
2127 "timeoutMS": 500,
2128 "filter": {}
2129 }
2130 }
2131 ],
2132 "expectEvents": [
2133 {
2134 "client": "client",
2135 "events": [
2136 {
2137 "commandStartedEvent": {
2138 "commandName": "listDatabases",
2139 "databaseName": "admin",
2140 "command": {
2141 "listDatabases": 1,
2142 "maxTimeMS": {
2143 "$$type": [
2144 "int",
2145 "long"
2146 ]
2147 }
2148 }
2149 }
2150 },
2151 {
2152 "commandStartedEvent": {
2153 "commandName": "listDatabases",
2154 "databaseName": "admin",
2155 "command": {
2156 "listDatabases": 1,
2157 "maxTimeMS": {
2158 "$$type": [
2159 "int",
2160 "long"
2161 ]
2162 }
2163 }
2164 }
2165 },
2166 {
2167 "commandStartedEvent": {
2168 "commandName": "listDatabases",
2169 "databaseName": "admin",
2170 "command": {
2171 "listDatabases": 1,
2172 "maxTimeMS": {
2173 "$$type": [
2174 "int",
2175 "long"
2176 ]
2177 }
2178 }
2179 }
2180 }
2181 ]
2182 }
2183 ]
2184 },
2185 {
2186 "description": "operation is retried multiple times if timeoutMS is zero - listDatabases on client",
2187 "operations": [
2188 {
2189 "name": "failPoint",
2190 "object": "testRunner",
2191 "arguments": {
2192 "client": "failPointClient",
2193 "failPoint": {
2194 "configureFailPoint": "failCommand",
2195 "mode": {
2196 "times": 2
2197 },
2198 "data": {
2199 "failCommands": [
2200 "listDatabases"
2201 ],
2202 "errorCode": 7,
2203 "closeConnection": false,
2204 "errorLabels": [
2205 "RetryableWriteError"
2206 ]
2207 }
2208 }
2209 }
2210 },
2211 {
2212 "name": "listDatabases",
2213 "object": "client",
2214 "arguments": {
2215 "timeoutMS": 0,
2216 "filter": {}
2217 }
2218 }
2219 ],
2220 "expectEvents": [
2221 {
2222 "client": "client",
2223 "events": [
2224 {
2225 "commandStartedEvent": {
2226 "commandName": "listDatabases",
2227 "databaseName": "admin",
2228 "command": {
2229 "listDatabases": 1,
2230 "maxTimeMS": {
2231 "$$exists": false
2232 }
2233 }
2234 }
2235 },
2236 {
2237 "commandStartedEvent": {
2238 "commandName": "listDatabases",
2239 "databaseName": "admin",
2240 "command": {
2241 "listDatabases": 1,
2242 "maxTimeMS": {
2243 "$$exists": false
2244 }
2245 }
2246 }
2247 },
2248 {
2249 "commandStartedEvent": {
2250 "commandName": "listDatabases",
2251 "databaseName": "admin",
2252 "command": {
2253 "listDatabases": 1,
2254 "maxTimeMS": {
2255 "$$exists": false
2256 }
2257 }
2258 }
2259 }
2260 ]
2261 }
2262 ]
2263 },
2264 {
2265 "description": "timeoutMS applies to whole operation, not individual attempts - listDatabaseNames on client",
2266 "runOnRequirements": [
2267 {
2268 "minServerVersion": "4.4"
2269 }
2270 ],
2271 "operations": [
2272 {
2273 "name": "failPoint",
2274 "object": "testRunner",
2275 "arguments": {
2276 "client": "failPointClient",
2277 "failPoint": {
2278 "configureFailPoint": "failCommand",
2279 "mode": {
2280 "times": 4
2281 },
2282 "data": {
2283 "failCommands": [
2284 "listDatabases"
2285 ],
2286 "blockConnection": true,
2287 "blockTimeMS": 60,
2288 "errorCode": 7,
2289 "errorLabels": [
2290 "RetryableWriteError"
2291 ]
2292 }
2293 }
2294 }
2295 },
2296 {
2297 "name": "listDatabaseNames",
2298 "object": "client",
2299 "expectError": {
2300 "isTimeoutError": true
2301 }
2302 }
2303 ]
2304 },
2305 {
2306 "description": "operation is retried multiple times for non-zero timeoutMS - listDatabaseNames on client",
2307 "operations": [
2308 {
2309 "name": "failPoint",
2310 "object": "testRunner",
2311 "arguments": {
2312 "client": "failPointClient",
2313 "failPoint": {
2314 "configureFailPoint": "failCommand",
2315 "mode": {
2316 "times": 2
2317 },
2318 "data": {
2319 "failCommands": [
2320 "listDatabases"
2321 ],
2322 "errorCode": 7,
2323 "closeConnection": false,
2324 "errorLabels": [
2325 "RetryableWriteError"
2326 ]
2327 }
2328 }
2329 }
2330 },
2331 {
2332 "name": "listDatabaseNames",
2333 "object": "client",
2334 "arguments": {
2335 "timeoutMS": 500
2336 }
2337 }
2338 ],
2339 "expectEvents": [
2340 {
2341 "client": "client",
2342 "events": [
2343 {
2344 "commandStartedEvent": {
2345 "commandName": "listDatabases",
2346 "databaseName": "admin",
2347 "command": {
2348 "listDatabases": 1,
2349 "maxTimeMS": {
2350 "$$type": [
2351 "int",
2352 "long"
2353 ]
2354 }
2355 }
2356 }
2357 },
2358 {
2359 "commandStartedEvent": {
2360 "commandName": "listDatabases",
2361 "databaseName": "admin",
2362 "command": {
2363 "listDatabases": 1,
2364 "maxTimeMS": {
2365 "$$type": [
2366 "int",
2367 "long"
2368 ]
2369 }
2370 }
2371 }
2372 },
2373 {
2374 "commandStartedEvent": {
2375 "commandName": "listDatabases",
2376 "databaseName": "admin",
2377 "command": {
2378 "listDatabases": 1,
2379 "maxTimeMS": {
2380 "$$type": [
2381 "int",
2382 "long"
2383 ]
2384 }
2385 }
2386 }
2387 }
2388 ]
2389 }
2390 ]
2391 },
2392 {
2393 "description": "operation is retried multiple times if timeoutMS is zero - listDatabaseNames on client",
2394 "operations": [
2395 {
2396 "name": "failPoint",
2397 "object": "testRunner",
2398 "arguments": {
2399 "client": "failPointClient",
2400 "failPoint": {
2401 "configureFailPoint": "failCommand",
2402 "mode": {
2403 "times": 2
2404 },
2405 "data": {
2406 "failCommands": [
2407 "listDatabases"
2408 ],
2409 "errorCode": 7,
2410 "closeConnection": false,
2411 "errorLabels": [
2412 "RetryableWriteError"
2413 ]
2414 }
2415 }
2416 }
2417 },
2418 {
2419 "name": "listDatabaseNames",
2420 "object": "client",
2421 "arguments": {
2422 "timeoutMS": 0
2423 }
2424 }
2425 ],
2426 "expectEvents": [
2427 {
2428 "client": "client",
2429 "events": [
2430 {
2431 "commandStartedEvent": {
2432 "commandName": "listDatabases",
2433 "databaseName": "admin",
2434 "command": {
2435 "listDatabases": 1,
2436 "maxTimeMS": {
2437 "$$exists": false
2438 }
2439 }
2440 }
2441 },
2442 {
2443 "commandStartedEvent": {
2444 "commandName": "listDatabases",
2445 "databaseName": "admin",
2446 "command": {
2447 "listDatabases": 1,
2448 "maxTimeMS": {
2449 "$$exists": false
2450 }
2451 }
2452 }
2453 },
2454 {
2455 "commandStartedEvent": {
2456 "commandName": "listDatabases",
2457 "databaseName": "admin",
2458 "command": {
2459 "listDatabases": 1,
2460 "maxTimeMS": {
2461 "$$exists": false
2462 }
2463 }
2464 }
2465 }
2466 ]
2467 }
2468 ]
2469 },
2470 {
2471 "description": "timeoutMS applies to whole operation, not individual attempts - createChangeStream on client",
2472 "runOnRequirements": [
2473 {
2474 "minServerVersion": "4.4"
2475 }
2476 ],
2477 "operations": [
2478 {
2479 "name": "failPoint",
2480 "object": "testRunner",
2481 "arguments": {
2482 "client": "failPointClient",
2483 "failPoint": {
2484 "configureFailPoint": "failCommand",
2485 "mode": {
2486 "times": 4
2487 },
2488 "data": {
2489 "failCommands": [
2490 "aggregate"
2491 ],
2492 "blockConnection": true,
2493 "blockTimeMS": 60,
2494 "errorCode": 7,
2495 "errorLabels": [
2496 "RetryableWriteError"
2497 ]
2498 }
2499 }
2500 }
2501 },
2502 {
2503 "name": "createChangeStream",
2504 "object": "client",
2505 "arguments": {
2506 "pipeline": []
2507 },
2508 "expectError": {
2509 "isTimeoutError": true
2510 }
2511 }
2512 ]
2513 },
2514 {
2515 "description": "operation is retried multiple times for non-zero timeoutMS - createChangeStream on client",
2516 "operations": [
2517 {
2518 "name": "failPoint",
2519 "object": "testRunner",
2520 "arguments": {
2521 "client": "failPointClient",
2522 "failPoint": {
2523 "configureFailPoint": "failCommand",
2524 "mode": {
2525 "times": 2
2526 },
2527 "data": {
2528 "failCommands": [
2529 "aggregate"
2530 ],
2531 "errorCode": 7,
2532 "closeConnection": false,
2533 "errorLabels": [
2534 "RetryableWriteError"
2535 ]
2536 }
2537 }
2538 }
2539 },
2540 {
2541 "name": "createChangeStream",
2542 "object": "client",
2543 "arguments": {
2544 "timeoutMS": 500,
2545 "pipeline": []
2546 }
2547 }
2548 ],
2549 "expectEvents": [
2550 {
2551 "client": "client",
2552 "events": [
2553 {
2554 "commandStartedEvent": {
2555 "commandName": "aggregate",
2556 "databaseName": "admin",
2557 "command": {
2558 "aggregate": 1,
2559 "maxTimeMS": {
2560 "$$type": [
2561 "int",
2562 "long"
2563 ]
2564 }
2565 }
2566 }
2567 },
2568 {
2569 "commandStartedEvent": {
2570 "commandName": "aggregate",
2571 "databaseName": "admin",
2572 "command": {
2573 "aggregate": 1,
2574 "maxTimeMS": {
2575 "$$type": [
2576 "int",
2577 "long"
2578 ]
2579 }
2580 }
2581 }
2582 },
2583 {
2584 "commandStartedEvent": {
2585 "commandName": "aggregate",
2586 "databaseName": "admin",
2587 "command": {
2588 "aggregate": 1,
2589 "maxTimeMS": {
2590 "$$type": [
2591 "int",
2592 "long"
2593 ]
2594 }
2595 }
2596 }
2597 }
2598 ]
2599 }
2600 ]
2601 },
2602 {
2603 "description": "operation is retried multiple times if timeoutMS is zero - createChangeStream on client",
2604 "operations": [
2605 {
2606 "name": "failPoint",
2607 "object": "testRunner",
2608 "arguments": {
2609 "client": "failPointClient",
2610 "failPoint": {
2611 "configureFailPoint": "failCommand",
2612 "mode": {
2613 "times": 2
2614 },
2615 "data": {
2616 "failCommands": [
2617 "aggregate"
2618 ],
2619 "errorCode": 7,
2620 "closeConnection": false,
2621 "errorLabels": [
2622 "RetryableWriteError"
2623 ]
2624 }
2625 }
2626 }
2627 },
2628 {
2629 "name": "createChangeStream",
2630 "object": "client",
2631 "arguments": {
2632 "timeoutMS": 0,
2633 "pipeline": []
2634 }
2635 }
2636 ],
2637 "expectEvents": [
2638 {
2639 "client": "client",
2640 "events": [
2641 {
2642 "commandStartedEvent": {
2643 "commandName": "aggregate",
2644 "databaseName": "admin",
2645 "command": {
2646 "aggregate": 1,
2647 "maxTimeMS": {
2648 "$$exists": false
2649 }
2650 }
2651 }
2652 },
2653 {
2654 "commandStartedEvent": {
2655 "commandName": "aggregate",
2656 "databaseName": "admin",
2657 "command": {
2658 "aggregate": 1,
2659 "maxTimeMS": {
2660 "$$exists": false
2661 }
2662 }
2663 }
2664 },
2665 {
2666 "commandStartedEvent": {
2667 "commandName": "aggregate",
2668 "databaseName": "admin",
2669 "command": {
2670 "aggregate": 1,
2671 "maxTimeMS": {
2672 "$$exists": false
2673 }
2674 }
2675 }
2676 }
2677 ]
2678 }
2679 ]
2680 },
2681 {
2682 "description": "timeoutMS applies to whole operation, not individual attempts - aggregate on database",
2683 "runOnRequirements": [
2684 {
2685 "minServerVersion": "4.4"
2686 }
2687 ],
2688 "operations": [
2689 {
2690 "name": "failPoint",
2691 "object": "testRunner",
2692 "arguments": {
2693 "client": "failPointClient",
2694 "failPoint": {
2695 "configureFailPoint": "failCommand",
2696 "mode": {
2697 "times": 4
2698 },
2699 "data": {
2700 "failCommands": [
2701 "aggregate"
2702 ],
2703 "blockConnection": true,
2704 "blockTimeMS": 60,
2705 "errorCode": 7,
2706 "errorLabels": [
2707 "RetryableWriteError"
2708 ]
2709 }
2710 }
2711 }
2712 },
2713 {
2714 "name": "aggregate",
2715 "object": "database",
2716 "arguments": {
2717 "pipeline": [
2718 {
2719 "$listLocalSessions": {}
2720 },
2721 {
2722 "$limit": 1
2723 }
2724 ]
2725 },
2726 "expectError": {
2727 "isTimeoutError": true
2728 }
2729 }
2730 ]
2731 },
2732 {
2733 "description": "operation is retried multiple times for non-zero timeoutMS - aggregate on database",
2734 "operations": [
2735 {
2736 "name": "failPoint",
2737 "object": "testRunner",
2738 "arguments": {
2739 "client": "failPointClient",
2740 "failPoint": {
2741 "configureFailPoint": "failCommand",
2742 "mode": {
2743 "times": 2
2744 },
2745 "data": {
2746 "failCommands": [
2747 "aggregate"
2748 ],
2749 "errorCode": 7,
2750 "closeConnection": false,
2751 "errorLabels": [
2752 "RetryableWriteError"
2753 ]
2754 }
2755 }
2756 }
2757 },
2758 {
2759 "name": "aggregate",
2760 "object": "database",
2761 "arguments": {
2762 "timeoutMS": 500,
2763 "pipeline": [
2764 {
2765 "$listLocalSessions": {}
2766 },
2767 {
2768 "$limit": 1
2769 }
2770 ]
2771 }
2772 }
2773 ],
2774 "expectEvents": [
2775 {
2776 "client": "client",
2777 "events": [
2778 {
2779 "commandStartedEvent": {
2780 "commandName": "aggregate",
2781 "databaseName": "test",
2782 "command": {
2783 "aggregate": 1,
2784 "maxTimeMS": {
2785 "$$type": [
2786 "int",
2787 "long"
2788 ]
2789 }
2790 }
2791 }
2792 },
2793 {
2794 "commandStartedEvent": {
2795 "commandName": "aggregate",
2796 "databaseName": "test",
2797 "command": {
2798 "aggregate": 1,
2799 "maxTimeMS": {
2800 "$$type": [
2801 "int",
2802 "long"
2803 ]
2804 }
2805 }
2806 }
2807 },
2808 {
2809 "commandStartedEvent": {
2810 "commandName": "aggregate",
2811 "databaseName": "test",
2812 "command": {
2813 "aggregate": 1,
2814 "maxTimeMS": {
2815 "$$type": [
2816 "int",
2817 "long"
2818 ]
2819 }
2820 }
2821 }
2822 }
2823 ]
2824 }
2825 ]
2826 },
2827 {
2828 "description": "operation is retried multiple times if timeoutMS is zero - aggregate on database",
2829 "operations": [
2830 {
2831 "name": "failPoint",
2832 "object": "testRunner",
2833 "arguments": {
2834 "client": "failPointClient",
2835 "failPoint": {
2836 "configureFailPoint": "failCommand",
2837 "mode": {
2838 "times": 2
2839 },
2840 "data": {
2841 "failCommands": [
2842 "aggregate"
2843 ],
2844 "errorCode": 7,
2845 "closeConnection": false,
2846 "errorLabels": [
2847 "RetryableWriteError"
2848 ]
2849 }
2850 }
2851 }
2852 },
2853 {
2854 "name": "aggregate",
2855 "object": "database",
2856 "arguments": {
2857 "timeoutMS": 0,
2858 "pipeline": [
2859 {
2860 "$listLocalSessions": {}
2861 },
2862 {
2863 "$limit": 1
2864 }
2865 ]
2866 }
2867 }
2868 ],
2869 "expectEvents": [
2870 {
2871 "client": "client",
2872 "events": [
2873 {
2874 "commandStartedEvent": {
2875 "commandName": "aggregate",
2876 "databaseName": "test",
2877 "command": {
2878 "aggregate": 1,
2879 "maxTimeMS": {
2880 "$$exists": false
2881 }
2882 }
2883 }
2884 },
2885 {
2886 "commandStartedEvent": {
2887 "commandName": "aggregate",
2888 "databaseName": "test",
2889 "command": {
2890 "aggregate": 1,
2891 "maxTimeMS": {
2892 "$$exists": false
2893 }
2894 }
2895 }
2896 },
2897 {
2898 "commandStartedEvent": {
2899 "commandName": "aggregate",
2900 "databaseName": "test",
2901 "command": {
2902 "aggregate": 1,
2903 "maxTimeMS": {
2904 "$$exists": false
2905 }
2906 }
2907 }
2908 }
2909 ]
2910 }
2911 ]
2912 },
2913 {
2914 "description": "timeoutMS applies to whole operation, not individual attempts - listCollections on database",
2915 "runOnRequirements": [
2916 {
2917 "minServerVersion": "4.4"
2918 }
2919 ],
2920 "operations": [
2921 {
2922 "name": "failPoint",
2923 "object": "testRunner",
2924 "arguments": {
2925 "client": "failPointClient",
2926 "failPoint": {
2927 "configureFailPoint": "failCommand",
2928 "mode": {
2929 "times": 4
2930 },
2931 "data": {
2932 "failCommands": [
2933 "listCollections"
2934 ],
2935 "blockConnection": true,
2936 "blockTimeMS": 60,
2937 "errorCode": 7,
2938 "errorLabels": [
2939 "RetryableWriteError"
2940 ]
2941 }
2942 }
2943 }
2944 },
2945 {
2946 "name": "listCollections",
2947 "object": "database",
2948 "arguments": {
2949 "filter": {}
2950 },
2951 "expectError": {
2952 "isTimeoutError": true
2953 }
2954 }
2955 ]
2956 },
2957 {
2958 "description": "operation is retried multiple times for non-zero timeoutMS - listCollections on database",
2959 "operations": [
2960 {
2961 "name": "failPoint",
2962 "object": "testRunner",
2963 "arguments": {
2964 "client": "failPointClient",
2965 "failPoint": {
2966 "configureFailPoint": "failCommand",
2967 "mode": {
2968 "times": 2
2969 },
2970 "data": {
2971 "failCommands": [
2972 "listCollections"
2973 ],
2974 "errorCode": 7,
2975 "closeConnection": false,
2976 "errorLabels": [
2977 "RetryableWriteError"
2978 ]
2979 }
2980 }
2981 }
2982 },
2983 {
2984 "name": "listCollections",
2985 "object": "database",
2986 "arguments": {
2987 "timeoutMS": 500,
2988 "filter": {}
2989 }
2990 }
2991 ],
2992 "expectEvents": [
2993 {
2994 "client": "client",
2995 "events": [
2996 {
2997 "commandStartedEvent": {
2998 "commandName": "listCollections",
2999 "databaseName": "test",
3000 "command": {
3001 "listCollections": 1,
3002 "maxTimeMS": {
3003 "$$type": [
3004 "int",
3005 "long"
3006 ]
3007 }
3008 }
3009 }
3010 },
3011 {
3012 "commandStartedEvent": {
3013 "commandName": "listCollections",
3014 "databaseName": "test",
3015 "command": {
3016 "listCollections": 1,
3017 "maxTimeMS": {
3018 "$$type": [
3019 "int",
3020 "long"
3021 ]
3022 }
3023 }
3024 }
3025 },
3026 {
3027 "commandStartedEvent": {
3028 "commandName": "listCollections",
3029 "databaseName": "test",
3030 "command": {
3031 "listCollections": 1,
3032 "maxTimeMS": {
3033 "$$type": [
3034 "int",
3035 "long"
3036 ]
3037 }
3038 }
3039 }
3040 }
3041 ]
3042 }
3043 ]
3044 },
3045 {
3046 "description": "operation is retried multiple times if timeoutMS is zero - listCollections on database",
3047 "operations": [
3048 {
3049 "name": "failPoint",
3050 "object": "testRunner",
3051 "arguments": {
3052 "client": "failPointClient",
3053 "failPoint": {
3054 "configureFailPoint": "failCommand",
3055 "mode": {
3056 "times": 2
3057 },
3058 "data": {
3059 "failCommands": [
3060 "listCollections"
3061 ],
3062 "errorCode": 7,
3063 "closeConnection": false,
3064 "errorLabels": [
3065 "RetryableWriteError"
3066 ]
3067 }
3068 }
3069 }
3070 },
3071 {
3072 "name": "listCollections",
3073 "object": "database",
3074 "arguments": {
3075 "timeoutMS": 0,
3076 "filter": {}
3077 }
3078 }
3079 ],
3080 "expectEvents": [
3081 {
3082 "client": "client",
3083 "events": [
3084 {
3085 "commandStartedEvent": {
3086 "commandName": "listCollections",
3087 "databaseName": "test",
3088 "command": {
3089 "listCollections": 1,
3090 "maxTimeMS": {
3091 "$$exists": false
3092 }
3093 }
3094 }
3095 },
3096 {
3097 "commandStartedEvent": {
3098 "commandName": "listCollections",
3099 "databaseName": "test",
3100 "command": {
3101 "listCollections": 1,
3102 "maxTimeMS": {
3103 "$$exists": false
3104 }
3105 }
3106 }
3107 },
3108 {
3109 "commandStartedEvent": {
3110 "commandName": "listCollections",
3111 "databaseName": "test",
3112 "command": {
3113 "listCollections": 1,
3114 "maxTimeMS": {
3115 "$$exists": false
3116 }
3117 }
3118 }
3119 }
3120 ]
3121 }
3122 ]
3123 },
3124 {
3125 "description": "timeoutMS applies to whole operation, not individual attempts - listCollectionNames on database",
3126 "runOnRequirements": [
3127 {
3128 "minServerVersion": "4.4"
3129 }
3130 ],
3131 "operations": [
3132 {
3133 "name": "failPoint",
3134 "object": "testRunner",
3135 "arguments": {
3136 "client": "failPointClient",
3137 "failPoint": {
3138 "configureFailPoint": "failCommand",
3139 "mode": {
3140 "times": 4
3141 },
3142 "data": {
3143 "failCommands": [
3144 "listCollections"
3145 ],
3146 "blockConnection": true,
3147 "blockTimeMS": 60,
3148 "errorCode": 7,
3149 "errorLabels": [
3150 "RetryableWriteError"
3151 ]
3152 }
3153 }
3154 }
3155 },
3156 {
3157 "name": "listCollectionNames",
3158 "object": "database",
3159 "arguments": {
3160 "filter": {}
3161 },
3162 "expectError": {
3163 "isTimeoutError": true
3164 }
3165 }
3166 ]
3167 },
3168 {
3169 "description": "operation is retried multiple times for non-zero timeoutMS - listCollectionNames on database",
3170 "operations": [
3171 {
3172 "name": "failPoint",
3173 "object": "testRunner",
3174 "arguments": {
3175 "client": "failPointClient",
3176 "failPoint": {
3177 "configureFailPoint": "failCommand",
3178 "mode": {
3179 "times": 2
3180 },
3181 "data": {
3182 "failCommands": [
3183 "listCollections"
3184 ],
3185 "errorCode": 7,
3186 "closeConnection": false,
3187 "errorLabels": [
3188 "RetryableWriteError"
3189 ]
3190 }
3191 }
3192 }
3193 },
3194 {
3195 "name": "listCollectionNames",
3196 "object": "database",
3197 "arguments": {
3198 "timeoutMS": 500,
3199 "filter": {}
3200 }
3201 }
3202 ],
3203 "expectEvents": [
3204 {
3205 "client": "client",
3206 "events": [
3207 {
3208 "commandStartedEvent": {
3209 "commandName": "listCollections",
3210 "databaseName": "test",
3211 "command": {
3212 "listCollections": 1,
3213 "maxTimeMS": {
3214 "$$type": [
3215 "int",
3216 "long"
3217 ]
3218 }
3219 }
3220 }
3221 },
3222 {
3223 "commandStartedEvent": {
3224 "commandName": "listCollections",
3225 "databaseName": "test",
3226 "command": {
3227 "listCollections": 1,
3228 "maxTimeMS": {
3229 "$$type": [
3230 "int",
3231 "long"
3232 ]
3233 }
3234 }
3235 }
3236 },
3237 {
3238 "commandStartedEvent": {
3239 "commandName": "listCollections",
3240 "databaseName": "test",
3241 "command": {
3242 "listCollections": 1,
3243 "maxTimeMS": {
3244 "$$type": [
3245 "int",
3246 "long"
3247 ]
3248 }
3249 }
3250 }
3251 }
3252 ]
3253 }
3254 ]
3255 },
3256 {
3257 "description": "operation is retried multiple times if timeoutMS is zero - listCollectionNames on database",
3258 "operations": [
3259 {
3260 "name": "failPoint",
3261 "object": "testRunner",
3262 "arguments": {
3263 "client": "failPointClient",
3264 "failPoint": {
3265 "configureFailPoint": "failCommand",
3266 "mode": {
3267 "times": 2
3268 },
3269 "data": {
3270 "failCommands": [
3271 "listCollections"
3272 ],
3273 "errorCode": 7,
3274 "closeConnection": false,
3275 "errorLabels": [
3276 "RetryableWriteError"
3277 ]
3278 }
3279 }
3280 }
3281 },
3282 {
3283 "name": "listCollectionNames",
3284 "object": "database",
3285 "arguments": {
3286 "timeoutMS": 0,
3287 "filter": {}
3288 }
3289 }
3290 ],
3291 "expectEvents": [
3292 {
3293 "client": "client",
3294 "events": [
3295 {
3296 "commandStartedEvent": {
3297 "commandName": "listCollections",
3298 "databaseName": "test",
3299 "command": {
3300 "listCollections": 1,
3301 "maxTimeMS": {
3302 "$$exists": false
3303 }
3304 }
3305 }
3306 },
3307 {
3308 "commandStartedEvent": {
3309 "commandName": "listCollections",
3310 "databaseName": "test",
3311 "command": {
3312 "listCollections": 1,
3313 "maxTimeMS": {
3314 "$$exists": false
3315 }
3316 }
3317 }
3318 },
3319 {
3320 "commandStartedEvent": {
3321 "commandName": "listCollections",
3322 "databaseName": "test",
3323 "command": {
3324 "listCollections": 1,
3325 "maxTimeMS": {
3326 "$$exists": false
3327 }
3328 }
3329 }
3330 }
3331 ]
3332 }
3333 ]
3334 },
3335 {
3336 "description": "timeoutMS applies to whole operation, not individual attempts - createChangeStream on database",
3337 "runOnRequirements": [
3338 {
3339 "minServerVersion": "4.4"
3340 }
3341 ],
3342 "operations": [
3343 {
3344 "name": "failPoint",
3345 "object": "testRunner",
3346 "arguments": {
3347 "client": "failPointClient",
3348 "failPoint": {
3349 "configureFailPoint": "failCommand",
3350 "mode": {
3351 "times": 4
3352 },
3353 "data": {
3354 "failCommands": [
3355 "aggregate"
3356 ],
3357 "blockConnection": true,
3358 "blockTimeMS": 60,
3359 "errorCode": 7,
3360 "errorLabels": [
3361 "RetryableWriteError"
3362 ]
3363 }
3364 }
3365 }
3366 },
3367 {
3368 "name": "createChangeStream",
3369 "object": "database",
3370 "arguments": {
3371 "pipeline": []
3372 },
3373 "expectError": {
3374 "isTimeoutError": true
3375 }
3376 }
3377 ]
3378 },
3379 {
3380 "description": "operation is retried multiple times for non-zero timeoutMS - createChangeStream on database",
3381 "operations": [
3382 {
3383 "name": "failPoint",
3384 "object": "testRunner",
3385 "arguments": {
3386 "client": "failPointClient",
3387 "failPoint": {
3388 "configureFailPoint": "failCommand",
3389 "mode": {
3390 "times": 2
3391 },
3392 "data": {
3393 "failCommands": [
3394 "aggregate"
3395 ],
3396 "errorCode": 7,
3397 "closeConnection": false,
3398 "errorLabels": [
3399 "RetryableWriteError"
3400 ]
3401 }
3402 }
3403 }
3404 },
3405 {
3406 "name": "createChangeStream",
3407 "object": "database",
3408 "arguments": {
3409 "timeoutMS": 500,
3410 "pipeline": []
3411 }
3412 }
3413 ],
3414 "expectEvents": [
3415 {
3416 "client": "client",
3417 "events": [
3418 {
3419 "commandStartedEvent": {
3420 "commandName": "aggregate",
3421 "databaseName": "test",
3422 "command": {
3423 "aggregate": 1,
3424 "maxTimeMS": {
3425 "$$type": [
3426 "int",
3427 "long"
3428 ]
3429 }
3430 }
3431 }
3432 },
3433 {
3434 "commandStartedEvent": {
3435 "commandName": "aggregate",
3436 "databaseName": "test",
3437 "command": {
3438 "aggregate": 1,
3439 "maxTimeMS": {
3440 "$$type": [
3441 "int",
3442 "long"
3443 ]
3444 }
3445 }
3446 }
3447 },
3448 {
3449 "commandStartedEvent": {
3450 "commandName": "aggregate",
3451 "databaseName": "test",
3452 "command": {
3453 "aggregate": 1,
3454 "maxTimeMS": {
3455 "$$type": [
3456 "int",
3457 "long"
3458 ]
3459 }
3460 }
3461 }
3462 }
3463 ]
3464 }
3465 ]
3466 },
3467 {
3468 "description": "operation is retried multiple times if timeoutMS is zero - createChangeStream on database",
3469 "operations": [
3470 {
3471 "name": "failPoint",
3472 "object": "testRunner",
3473 "arguments": {
3474 "client": "failPointClient",
3475 "failPoint": {
3476 "configureFailPoint": "failCommand",
3477 "mode": {
3478 "times": 2
3479 },
3480 "data": {
3481 "failCommands": [
3482 "aggregate"
3483 ],
3484 "errorCode": 7,
3485 "closeConnection": false,
3486 "errorLabels": [
3487 "RetryableWriteError"
3488 ]
3489 }
3490 }
3491 }
3492 },
3493 {
3494 "name": "createChangeStream",
3495 "object": "database",
3496 "arguments": {
3497 "timeoutMS": 0,
3498 "pipeline": []
3499 }
3500 }
3501 ],
3502 "expectEvents": [
3503 {
3504 "client": "client",
3505 "events": [
3506 {
3507 "commandStartedEvent": {
3508 "commandName": "aggregate",
3509 "databaseName": "test",
3510 "command": {
3511 "aggregate": 1,
3512 "maxTimeMS": {
3513 "$$exists": false
3514 }
3515 }
3516 }
3517 },
3518 {
3519 "commandStartedEvent": {
3520 "commandName": "aggregate",
3521 "databaseName": "test",
3522 "command": {
3523 "aggregate": 1,
3524 "maxTimeMS": {
3525 "$$exists": false
3526 }
3527 }
3528 }
3529 },
3530 {
3531 "commandStartedEvent": {
3532 "commandName": "aggregate",
3533 "databaseName": "test",
3534 "command": {
3535 "aggregate": 1,
3536 "maxTimeMS": {
3537 "$$exists": false
3538 }
3539 }
3540 }
3541 }
3542 ]
3543 }
3544 ]
3545 },
3546 {
3547 "description": "timeoutMS applies to whole operation, not individual attempts - aggregate on collection",
3548 "runOnRequirements": [
3549 {
3550 "minServerVersion": "4.4"
3551 }
3552 ],
3553 "operations": [
3554 {
3555 "name": "failPoint",
3556 "object": "testRunner",
3557 "arguments": {
3558 "client": "failPointClient",
3559 "failPoint": {
3560 "configureFailPoint": "failCommand",
3561 "mode": {
3562 "times": 4
3563 },
3564 "data": {
3565 "failCommands": [
3566 "aggregate"
3567 ],
3568 "blockConnection": true,
3569 "blockTimeMS": 60,
3570 "errorCode": 7,
3571 "errorLabels": [
3572 "RetryableWriteError"
3573 ]
3574 }
3575 }
3576 }
3577 },
3578 {
3579 "name": "aggregate",
3580 "object": "collection",
3581 "arguments": {
3582 "pipeline": []
3583 },
3584 "expectError": {
3585 "isTimeoutError": true
3586 }
3587 }
3588 ]
3589 },
3590 {
3591 "description": "operation is retried multiple times for non-zero timeoutMS - aggregate on collection",
3592 "operations": [
3593 {
3594 "name": "failPoint",
3595 "object": "testRunner",
3596 "arguments": {
3597 "client": "failPointClient",
3598 "failPoint": {
3599 "configureFailPoint": "failCommand",
3600 "mode": {
3601 "times": 2
3602 },
3603 "data": {
3604 "failCommands": [
3605 "aggregate"
3606 ],
3607 "errorCode": 7,
3608 "closeConnection": false,
3609 "errorLabels": [
3610 "RetryableWriteError"
3611 ]
3612 }
3613 }
3614 }
3615 },
3616 {
3617 "name": "aggregate",
3618 "object": "collection",
3619 "arguments": {
3620 "timeoutMS": 500,
3621 "pipeline": []
3622 }
3623 }
3624 ],
3625 "expectEvents": [
3626 {
3627 "client": "client",
3628 "events": [
3629 {
3630 "commandStartedEvent": {
3631 "commandName": "aggregate",
3632 "databaseName": "test",
3633 "command": {
3634 "aggregate": "coll",
3635 "maxTimeMS": {
3636 "$$type": [
3637 "int",
3638 "long"
3639 ]
3640 }
3641 }
3642 }
3643 },
3644 {
3645 "commandStartedEvent": {
3646 "commandName": "aggregate",
3647 "databaseName": "test",
3648 "command": {
3649 "aggregate": "coll",
3650 "maxTimeMS": {
3651 "$$type": [
3652 "int",
3653 "long"
3654 ]
3655 }
3656 }
3657 }
3658 },
3659 {
3660 "commandStartedEvent": {
3661 "commandName": "aggregate",
3662 "databaseName": "test",
3663 "command": {
3664 "aggregate": "coll",
3665 "maxTimeMS": {
3666 "$$type": [
3667 "int",
3668 "long"
3669 ]
3670 }
3671 }
3672 }
3673 }
3674 ]
3675 }
3676 ]
3677 },
3678 {
3679 "description": "operation is retried multiple times if timeoutMS is zero - aggregate on collection",
3680 "operations": [
3681 {
3682 "name": "failPoint",
3683 "object": "testRunner",
3684 "arguments": {
3685 "client": "failPointClient",
3686 "failPoint": {
3687 "configureFailPoint": "failCommand",
3688 "mode": {
3689 "times": 2
3690 },
3691 "data": {
3692 "failCommands": [
3693 "aggregate"
3694 ],
3695 "errorCode": 7,
3696 "closeConnection": false,
3697 "errorLabels": [
3698 "RetryableWriteError"
3699 ]
3700 }
3701 }
3702 }
3703 },
3704 {
3705 "name": "aggregate",
3706 "object": "collection",
3707 "arguments": {
3708 "timeoutMS": 0,
3709 "pipeline": []
3710 }
3711 }
3712 ],
3713 "expectEvents": [
3714 {
3715 "client": "client",
3716 "events": [
3717 {
3718 "commandStartedEvent": {
3719 "commandName": "aggregate",
3720 "databaseName": "test",
3721 "command": {
3722 "aggregate": "coll",
3723 "maxTimeMS": {
3724 "$$exists": false
3725 }
3726 }
3727 }
3728 },
3729 {
3730 "commandStartedEvent": {
3731 "commandName": "aggregate",
3732 "databaseName": "test",
3733 "command": {
3734 "aggregate": "coll",
3735 "maxTimeMS": {
3736 "$$exists": false
3737 }
3738 }
3739 }
3740 },
3741 {
3742 "commandStartedEvent": {
3743 "commandName": "aggregate",
3744 "databaseName": "test",
3745 "command": {
3746 "aggregate": "coll",
3747 "maxTimeMS": {
3748 "$$exists": false
3749 }
3750 }
3751 }
3752 }
3753 ]
3754 }
3755 ]
3756 },
3757 {
3758 "description": "timeoutMS applies to whole operation, not individual attempts - count on collection",
3759 "runOnRequirements": [
3760 {
3761 "minServerVersion": "4.4"
3762 }
3763 ],
3764 "operations": [
3765 {
3766 "name": "failPoint",
3767 "object": "testRunner",
3768 "arguments": {
3769 "client": "failPointClient",
3770 "failPoint": {
3771 "configureFailPoint": "failCommand",
3772 "mode": {
3773 "times": 4
3774 },
3775 "data": {
3776 "failCommands": [
3777 "count"
3778 ],
3779 "blockConnection": true,
3780 "blockTimeMS": 60,
3781 "errorCode": 7,
3782 "errorLabels": [
3783 "RetryableWriteError"
3784 ]
3785 }
3786 }
3787 }
3788 },
3789 {
3790 "name": "count",
3791 "object": "collection",
3792 "arguments": {
3793 "filter": {}
3794 },
3795 "expectError": {
3796 "isTimeoutError": true
3797 }
3798 }
3799 ]
3800 },
3801 {
3802 "description": "operation is retried multiple times for non-zero timeoutMS - count on collection",
3803 "operations": [
3804 {
3805 "name": "failPoint",
3806 "object": "testRunner",
3807 "arguments": {
3808 "client": "failPointClient",
3809 "failPoint": {
3810 "configureFailPoint": "failCommand",
3811 "mode": {
3812 "times": 2
3813 },
3814 "data": {
3815 "failCommands": [
3816 "count"
3817 ],
3818 "errorCode": 7,
3819 "closeConnection": false,
3820 "errorLabels": [
3821 "RetryableWriteError"
3822 ]
3823 }
3824 }
3825 }
3826 },
3827 {
3828 "name": "count",
3829 "object": "collection",
3830 "arguments": {
3831 "timeoutMS": 500,
3832 "filter": {}
3833 }
3834 }
3835 ],
3836 "expectEvents": [
3837 {
3838 "client": "client",
3839 "events": [
3840 {
3841 "commandStartedEvent": {
3842 "commandName": "count",
3843 "databaseName": "test",
3844 "command": {
3845 "count": "coll",
3846 "maxTimeMS": {
3847 "$$type": [
3848 "int",
3849 "long"
3850 ]
3851 }
3852 }
3853 }
3854 },
3855 {
3856 "commandStartedEvent": {
3857 "commandName": "count",
3858 "databaseName": "test",
3859 "command": {
3860 "count": "coll",
3861 "maxTimeMS": {
3862 "$$type": [
3863 "int",
3864 "long"
3865 ]
3866 }
3867 }
3868 }
3869 },
3870 {
3871 "commandStartedEvent": {
3872 "commandName": "count",
3873 "databaseName": "test",
3874 "command": {
3875 "count": "coll",
3876 "maxTimeMS": {
3877 "$$type": [
3878 "int",
3879 "long"
3880 ]
3881 }
3882 }
3883 }
3884 }
3885 ]
3886 }
3887 ]
3888 },
3889 {
3890 "description": "operation is retried multiple times if timeoutMS is zero - count on collection",
3891 "operations": [
3892 {
3893 "name": "failPoint",
3894 "object": "testRunner",
3895 "arguments": {
3896 "client": "failPointClient",
3897 "failPoint": {
3898 "configureFailPoint": "failCommand",
3899 "mode": {
3900 "times": 2
3901 },
3902 "data": {
3903 "failCommands": [
3904 "count"
3905 ],
3906 "errorCode": 7,
3907 "closeConnection": false,
3908 "errorLabels": [
3909 "RetryableWriteError"
3910 ]
3911 }
3912 }
3913 }
3914 },
3915 {
3916 "name": "count",
3917 "object": "collection",
3918 "arguments": {
3919 "timeoutMS": 0,
3920 "filter": {}
3921 }
3922 }
3923 ],
3924 "expectEvents": [
3925 {
3926 "client": "client",
3927 "events": [
3928 {
3929 "commandStartedEvent": {
3930 "commandName": "count",
3931 "databaseName": "test",
3932 "command": {
3933 "count": "coll",
3934 "maxTimeMS": {
3935 "$$exists": false
3936 }
3937 }
3938 }
3939 },
3940 {
3941 "commandStartedEvent": {
3942 "commandName": "count",
3943 "databaseName": "test",
3944 "command": {
3945 "count": "coll",
3946 "maxTimeMS": {
3947 "$$exists": false
3948 }
3949 }
3950 }
3951 },
3952 {
3953 "commandStartedEvent": {
3954 "commandName": "count",
3955 "databaseName": "test",
3956 "command": {
3957 "count": "coll",
3958 "maxTimeMS": {
3959 "$$exists": false
3960 }
3961 }
3962 }
3963 }
3964 ]
3965 }
3966 ]
3967 },
3968 {
3969 "description": "timeoutMS applies to whole operation, not individual attempts - countDocuments on collection",
3970 "runOnRequirements": [
3971 {
3972 "minServerVersion": "4.4"
3973 }
3974 ],
3975 "operations": [
3976 {
3977 "name": "failPoint",
3978 "object": "testRunner",
3979 "arguments": {
3980 "client": "failPointClient",
3981 "failPoint": {
3982 "configureFailPoint": "failCommand",
3983 "mode": {
3984 "times": 4
3985 },
3986 "data": {
3987 "failCommands": [
3988 "aggregate"
3989 ],
3990 "blockConnection": true,
3991 "blockTimeMS": 60,
3992 "errorCode": 7,
3993 "errorLabels": [
3994 "RetryableWriteError"
3995 ]
3996 }
3997 }
3998 }
3999 },
4000 {
4001 "name": "countDocuments",
4002 "object": "collection",
4003 "arguments": {
4004 "filter": {}
4005 },
4006 "expectError": {
4007 "isTimeoutError": true
4008 }
4009 }
4010 ]
4011 },
4012 {
4013 "description": "operation is retried multiple times for non-zero timeoutMS - countDocuments on collection",
4014 "operations": [
4015 {
4016 "name": "failPoint",
4017 "object": "testRunner",
4018 "arguments": {
4019 "client": "failPointClient",
4020 "failPoint": {
4021 "configureFailPoint": "failCommand",
4022 "mode": {
4023 "times": 2
4024 },
4025 "data": {
4026 "failCommands": [
4027 "aggregate"
4028 ],
4029 "errorCode": 7,
4030 "closeConnection": false,
4031 "errorLabels": [
4032 "RetryableWriteError"
4033 ]
4034 }
4035 }
4036 }
4037 },
4038 {
4039 "name": "countDocuments",
4040 "object": "collection",
4041 "arguments": {
4042 "timeoutMS": 500,
4043 "filter": {}
4044 }
4045 }
4046 ],
4047 "expectEvents": [
4048 {
4049 "client": "client",
4050 "events": [
4051 {
4052 "commandStartedEvent": {
4053 "commandName": "aggregate",
4054 "databaseName": "test",
4055 "command": {
4056 "aggregate": "coll",
4057 "maxTimeMS": {
4058 "$$type": [
4059 "int",
4060 "long"
4061 ]
4062 }
4063 }
4064 }
4065 },
4066 {
4067 "commandStartedEvent": {
4068 "commandName": "aggregate",
4069 "databaseName": "test",
4070 "command": {
4071 "aggregate": "coll",
4072 "maxTimeMS": {
4073 "$$type": [
4074 "int",
4075 "long"
4076 ]
4077 }
4078 }
4079 }
4080 },
4081 {
4082 "commandStartedEvent": {
4083 "commandName": "aggregate",
4084 "databaseName": "test",
4085 "command": {
4086 "aggregate": "coll",
4087 "maxTimeMS": {
4088 "$$type": [
4089 "int",
4090 "long"
4091 ]
4092 }
4093 }
4094 }
4095 }
4096 ]
4097 }
4098 ]
4099 },
4100 {
4101 "description": "operation is retried multiple times if timeoutMS is zero - countDocuments on collection",
4102 "operations": [
4103 {
4104 "name": "failPoint",
4105 "object": "testRunner",
4106 "arguments": {
4107 "client": "failPointClient",
4108 "failPoint": {
4109 "configureFailPoint": "failCommand",
4110 "mode": {
4111 "times": 2
4112 },
4113 "data": {
4114 "failCommands": [
4115 "aggregate"
4116 ],
4117 "errorCode": 7,
4118 "closeConnection": false,
4119 "errorLabels": [
4120 "RetryableWriteError"
4121 ]
4122 }
4123 }
4124 }
4125 },
4126 {
4127 "name": "countDocuments",
4128 "object": "collection",
4129 "arguments": {
4130 "timeoutMS": 0,
4131 "filter": {}
4132 }
4133 }
4134 ],
4135 "expectEvents": [
4136 {
4137 "client": "client",
4138 "events": [
4139 {
4140 "commandStartedEvent": {
4141 "commandName": "aggregate",
4142 "databaseName": "test",
4143 "command": {
4144 "aggregate": "coll",
4145 "maxTimeMS": {
4146 "$$exists": false
4147 }
4148 }
4149 }
4150 },
4151 {
4152 "commandStartedEvent": {
4153 "commandName": "aggregate",
4154 "databaseName": "test",
4155 "command": {
4156 "aggregate": "coll",
4157 "maxTimeMS": {
4158 "$$exists": false
4159 }
4160 }
4161 }
4162 },
4163 {
4164 "commandStartedEvent": {
4165 "commandName": "aggregate",
4166 "databaseName": "test",
4167 "command": {
4168 "aggregate": "coll",
4169 "maxTimeMS": {
4170 "$$exists": false
4171 }
4172 }
4173 }
4174 }
4175 ]
4176 }
4177 ]
4178 },
4179 {
4180 "description": "timeoutMS applies to whole operation, not individual attempts - estimatedDocumentCount on collection",
4181 "runOnRequirements": [
4182 {
4183 "minServerVersion": "4.4"
4184 }
4185 ],
4186 "operations": [
4187 {
4188 "name": "failPoint",
4189 "object": "testRunner",
4190 "arguments": {
4191 "client": "failPointClient",
4192 "failPoint": {
4193 "configureFailPoint": "failCommand",
4194 "mode": {
4195 "times": 4
4196 },
4197 "data": {
4198 "failCommands": [
4199 "count"
4200 ],
4201 "blockConnection": true,
4202 "blockTimeMS": 60,
4203 "errorCode": 7,
4204 "errorLabels": [
4205 "RetryableWriteError"
4206 ]
4207 }
4208 }
4209 }
4210 },
4211 {
4212 "name": "estimatedDocumentCount",
4213 "object": "collection",
4214 "expectError": {
4215 "isTimeoutError": true
4216 }
4217 }
4218 ]
4219 },
4220 {
4221 "description": "operation is retried multiple times for non-zero timeoutMS - estimatedDocumentCount on collection",
4222 "operations": [
4223 {
4224 "name": "failPoint",
4225 "object": "testRunner",
4226 "arguments": {
4227 "client": "failPointClient",
4228 "failPoint": {
4229 "configureFailPoint": "failCommand",
4230 "mode": {
4231 "times": 2
4232 },
4233 "data": {
4234 "failCommands": [
4235 "count"
4236 ],
4237 "errorCode": 7,
4238 "closeConnection": false,
4239 "errorLabels": [
4240 "RetryableWriteError"
4241 ]
4242 }
4243 }
4244 }
4245 },
4246 {
4247 "name": "estimatedDocumentCount",
4248 "object": "collection",
4249 "arguments": {
4250 "timeoutMS": 500
4251 }
4252 }
4253 ],
4254 "expectEvents": [
4255 {
4256 "client": "client",
4257 "events": [
4258 {
4259 "commandStartedEvent": {
4260 "commandName": "count",
4261 "databaseName": "test",
4262 "command": {
4263 "count": "coll",
4264 "maxTimeMS": {
4265 "$$type": [
4266 "int",
4267 "long"
4268 ]
4269 }
4270 }
4271 }
4272 },
4273 {
4274 "commandStartedEvent": {
4275 "commandName": "count",
4276 "databaseName": "test",
4277 "command": {
4278 "count": "coll",
4279 "maxTimeMS": {
4280 "$$type": [
4281 "int",
4282 "long"
4283 ]
4284 }
4285 }
4286 }
4287 },
4288 {
4289 "commandStartedEvent": {
4290 "commandName": "count",
4291 "databaseName": "test",
4292 "command": {
4293 "count": "coll",
4294 "maxTimeMS": {
4295 "$$type": [
4296 "int",
4297 "long"
4298 ]
4299 }
4300 }
4301 }
4302 }
4303 ]
4304 }
4305 ]
4306 },
4307 {
4308 "description": "operation is retried multiple times if timeoutMS is zero - estimatedDocumentCount on collection",
4309 "operations": [
4310 {
4311 "name": "failPoint",
4312 "object": "testRunner",
4313 "arguments": {
4314 "client": "failPointClient",
4315 "failPoint": {
4316 "configureFailPoint": "failCommand",
4317 "mode": {
4318 "times": 2
4319 },
4320 "data": {
4321 "failCommands": [
4322 "count"
4323 ],
4324 "errorCode": 7,
4325 "closeConnection": false,
4326 "errorLabels": [
4327 "RetryableWriteError"
4328 ]
4329 }
4330 }
4331 }
4332 },
4333 {
4334 "name": "estimatedDocumentCount",
4335 "object": "collection",
4336 "arguments": {
4337 "timeoutMS": 0
4338 }
4339 }
4340 ],
4341 "expectEvents": [
4342 {
4343 "client": "client",
4344 "events": [
4345 {
4346 "commandStartedEvent": {
4347 "commandName": "count",
4348 "databaseName": "test",
4349 "command": {
4350 "count": "coll",
4351 "maxTimeMS": {
4352 "$$exists": false
4353 }
4354 }
4355 }
4356 },
4357 {
4358 "commandStartedEvent": {
4359 "commandName": "count",
4360 "databaseName": "test",
4361 "command": {
4362 "count": "coll",
4363 "maxTimeMS": {
4364 "$$exists": false
4365 }
4366 }
4367 }
4368 },
4369 {
4370 "commandStartedEvent": {
4371 "commandName": "count",
4372 "databaseName": "test",
4373 "command": {
4374 "count": "coll",
4375 "maxTimeMS": {
4376 "$$exists": false
4377 }
4378 }
4379 }
4380 }
4381 ]
4382 }
4383 ]
4384 },
4385 {
4386 "description": "timeoutMS applies to whole operation, not individual attempts - distinct on collection",
4387 "runOnRequirements": [
4388 {
4389 "minServerVersion": "4.4"
4390 }
4391 ],
4392 "operations": [
4393 {
4394 "name": "failPoint",
4395 "object": "testRunner",
4396 "arguments": {
4397 "client": "failPointClient",
4398 "failPoint": {
4399 "configureFailPoint": "failCommand",
4400 "mode": {
4401 "times": 4
4402 },
4403 "data": {
4404 "failCommands": [
4405 "distinct"
4406 ],
4407 "blockConnection": true,
4408 "blockTimeMS": 60,
4409 "errorCode": 7,
4410 "errorLabels": [
4411 "RetryableWriteError"
4412 ]
4413 }
4414 }
4415 }
4416 },
4417 {
4418 "name": "distinct",
4419 "object": "collection",
4420 "arguments": {
4421 "fieldName": "x",
4422 "filter": {}
4423 },
4424 "expectError": {
4425 "isTimeoutError": true
4426 }
4427 }
4428 ]
4429 },
4430 {
4431 "description": "operation is retried multiple times for non-zero timeoutMS - distinct on collection",
4432 "operations": [
4433 {
4434 "name": "failPoint",
4435 "object": "testRunner",
4436 "arguments": {
4437 "client": "failPointClient",
4438 "failPoint": {
4439 "configureFailPoint": "failCommand",
4440 "mode": {
4441 "times": 2
4442 },
4443 "data": {
4444 "failCommands": [
4445 "distinct"
4446 ],
4447 "errorCode": 7,
4448 "closeConnection": false,
4449 "errorLabels": [
4450 "RetryableWriteError"
4451 ]
4452 }
4453 }
4454 }
4455 },
4456 {
4457 "name": "distinct",
4458 "object": "collection",
4459 "arguments": {
4460 "timeoutMS": 500,
4461 "fieldName": "x",
4462 "filter": {}
4463 }
4464 }
4465 ],
4466 "expectEvents": [
4467 {
4468 "client": "client",
4469 "events": [
4470 {
4471 "commandStartedEvent": {
4472 "commandName": "distinct",
4473 "databaseName": "test",
4474 "command": {
4475 "distinct": "coll",
4476 "maxTimeMS": {
4477 "$$type": [
4478 "int",
4479 "long"
4480 ]
4481 }
4482 }
4483 }
4484 },
4485 {
4486 "commandStartedEvent": {
4487 "commandName": "distinct",
4488 "databaseName": "test",
4489 "command": {
4490 "distinct": "coll",
4491 "maxTimeMS": {
4492 "$$type": [
4493 "int",
4494 "long"
4495 ]
4496 }
4497 }
4498 }
4499 },
4500 {
4501 "commandStartedEvent": {
4502 "commandName": "distinct",
4503 "databaseName": "test",
4504 "command": {
4505 "distinct": "coll",
4506 "maxTimeMS": {
4507 "$$type": [
4508 "int",
4509 "long"
4510 ]
4511 }
4512 }
4513 }
4514 }
4515 ]
4516 }
4517 ]
4518 },
4519 {
4520 "description": "operation is retried multiple times if timeoutMS is zero - distinct on collection",
4521 "operations": [
4522 {
4523 "name": "failPoint",
4524 "object": "testRunner",
4525 "arguments": {
4526 "client": "failPointClient",
4527 "failPoint": {
4528 "configureFailPoint": "failCommand",
4529 "mode": {
4530 "times": 2
4531 },
4532 "data": {
4533 "failCommands": [
4534 "distinct"
4535 ],
4536 "errorCode": 7,
4537 "closeConnection": false,
4538 "errorLabels": [
4539 "RetryableWriteError"
4540 ]
4541 }
4542 }
4543 }
4544 },
4545 {
4546 "name": "distinct",
4547 "object": "collection",
4548 "arguments": {
4549 "timeoutMS": 0,
4550 "fieldName": "x",
4551 "filter": {}
4552 }
4553 }
4554 ],
4555 "expectEvents": [
4556 {
4557 "client": "client",
4558 "events": [
4559 {
4560 "commandStartedEvent": {
4561 "commandName": "distinct",
4562 "databaseName": "test",
4563 "command": {
4564 "distinct": "coll",
4565 "maxTimeMS": {
4566 "$$exists": false
4567 }
4568 }
4569 }
4570 },
4571 {
4572 "commandStartedEvent": {
4573 "commandName": "distinct",
4574 "databaseName": "test",
4575 "command": {
4576 "distinct": "coll",
4577 "maxTimeMS": {
4578 "$$exists": false
4579 }
4580 }
4581 }
4582 },
4583 {
4584 "commandStartedEvent": {
4585 "commandName": "distinct",
4586 "databaseName": "test",
4587 "command": {
4588 "distinct": "coll",
4589 "maxTimeMS": {
4590 "$$exists": false
4591 }
4592 }
4593 }
4594 }
4595 ]
4596 }
4597 ]
4598 },
4599 {
4600 "description": "timeoutMS applies to whole operation, not individual attempts - find on collection",
4601 "runOnRequirements": [
4602 {
4603 "minServerVersion": "4.4"
4604 }
4605 ],
4606 "operations": [
4607 {
4608 "name": "failPoint",
4609 "object": "testRunner",
4610 "arguments": {
4611 "client": "failPointClient",
4612 "failPoint": {
4613 "configureFailPoint": "failCommand",
4614 "mode": {
4615 "times": 4
4616 },
4617 "data": {
4618 "failCommands": [
4619 "find"
4620 ],
4621 "blockConnection": true,
4622 "blockTimeMS": 60,
4623 "errorCode": 7,
4624 "errorLabels": [
4625 "RetryableWriteError"
4626 ]
4627 }
4628 }
4629 }
4630 },
4631 {
4632 "name": "find",
4633 "object": "collection",
4634 "arguments": {
4635 "filter": {}
4636 },
4637 "expectError": {
4638 "isTimeoutError": true
4639 }
4640 }
4641 ]
4642 },
4643 {
4644 "description": "operation is retried multiple times for non-zero timeoutMS - find on collection",
4645 "operations": [
4646 {
4647 "name": "failPoint",
4648 "object": "testRunner",
4649 "arguments": {
4650 "client": "failPointClient",
4651 "failPoint": {
4652 "configureFailPoint": "failCommand",
4653 "mode": {
4654 "times": 2
4655 },
4656 "data": {
4657 "failCommands": [
4658 "find"
4659 ],
4660 "errorCode": 7,
4661 "closeConnection": false,
4662 "errorLabels": [
4663 "RetryableWriteError"
4664 ]
4665 }
4666 }
4667 }
4668 },
4669 {
4670 "name": "find",
4671 "object": "collection",
4672 "arguments": {
4673 "timeoutMS": 500,
4674 "filter": {}
4675 }
4676 }
4677 ],
4678 "expectEvents": [
4679 {
4680 "client": "client",
4681 "events": [
4682 {
4683 "commandStartedEvent": {
4684 "commandName": "find",
4685 "databaseName": "test",
4686 "command": {
4687 "find": "coll",
4688 "maxTimeMS": {
4689 "$$type": [
4690 "int",
4691 "long"
4692 ]
4693 }
4694 }
4695 }
4696 },
4697 {
4698 "commandStartedEvent": {
4699 "commandName": "find",
4700 "databaseName": "test",
4701 "command": {
4702 "find": "coll",
4703 "maxTimeMS": {
4704 "$$type": [
4705 "int",
4706 "long"
4707 ]
4708 }
4709 }
4710 }
4711 },
4712 {
4713 "commandStartedEvent": {
4714 "commandName": "find",
4715 "databaseName": "test",
4716 "command": {
4717 "find": "coll",
4718 "maxTimeMS": {
4719 "$$type": [
4720 "int",
4721 "long"
4722 ]
4723 }
4724 }
4725 }
4726 }
4727 ]
4728 }
4729 ]
4730 },
4731 {
4732 "description": "operation is retried multiple times if timeoutMS is zero - find on collection",
4733 "operations": [
4734 {
4735 "name": "failPoint",
4736 "object": "testRunner",
4737 "arguments": {
4738 "client": "failPointClient",
4739 "failPoint": {
4740 "configureFailPoint": "failCommand",
4741 "mode": {
4742 "times": 2
4743 },
4744 "data": {
4745 "failCommands": [
4746 "find"
4747 ],
4748 "errorCode": 7,
4749 "closeConnection": false,
4750 "errorLabels": [
4751 "RetryableWriteError"
4752 ]
4753 }
4754 }
4755 }
4756 },
4757 {
4758 "name": "find",
4759 "object": "collection",
4760 "arguments": {
4761 "timeoutMS": 0,
4762 "filter": {}
4763 }
4764 }
4765 ],
4766 "expectEvents": [
4767 {
4768 "client": "client",
4769 "events": [
4770 {
4771 "commandStartedEvent": {
4772 "commandName": "find",
4773 "databaseName": "test",
4774 "command": {
4775 "find": "coll",
4776 "maxTimeMS": {
4777 "$$exists": false
4778 }
4779 }
4780 }
4781 },
4782 {
4783 "commandStartedEvent": {
4784 "commandName": "find",
4785 "databaseName": "test",
4786 "command": {
4787 "find": "coll",
4788 "maxTimeMS": {
4789 "$$exists": false
4790 }
4791 }
4792 }
4793 },
4794 {
4795 "commandStartedEvent": {
4796 "commandName": "find",
4797 "databaseName": "test",
4798 "command": {
4799 "find": "coll",
4800 "maxTimeMS": {
4801 "$$exists": false
4802 }
4803 }
4804 }
4805 }
4806 ]
4807 }
4808 ]
4809 },
4810 {
4811 "description": "timeoutMS applies to whole operation, not individual attempts - findOne on collection",
4812 "runOnRequirements": [
4813 {
4814 "minServerVersion": "4.4"
4815 }
4816 ],
4817 "operations": [
4818 {
4819 "name": "failPoint",
4820 "object": "testRunner",
4821 "arguments": {
4822 "client": "failPointClient",
4823 "failPoint": {
4824 "configureFailPoint": "failCommand",
4825 "mode": {
4826 "times": 4
4827 },
4828 "data": {
4829 "failCommands": [
4830 "find"
4831 ],
4832 "blockConnection": true,
4833 "blockTimeMS": 60,
4834 "errorCode": 7,
4835 "errorLabels": [
4836 "RetryableWriteError"
4837 ]
4838 }
4839 }
4840 }
4841 },
4842 {
4843 "name": "findOne",
4844 "object": "collection",
4845 "arguments": {
4846 "filter": {}
4847 },
4848 "expectError": {
4849 "isTimeoutError": true
4850 }
4851 }
4852 ]
4853 },
4854 {
4855 "description": "operation is retried multiple times for non-zero timeoutMS - findOne on collection",
4856 "operations": [
4857 {
4858 "name": "failPoint",
4859 "object": "testRunner",
4860 "arguments": {
4861 "client": "failPointClient",
4862 "failPoint": {
4863 "configureFailPoint": "failCommand",
4864 "mode": {
4865 "times": 2
4866 },
4867 "data": {
4868 "failCommands": [
4869 "find"
4870 ],
4871 "errorCode": 7,
4872 "closeConnection": false,
4873 "errorLabels": [
4874 "RetryableWriteError"
4875 ]
4876 }
4877 }
4878 }
4879 },
4880 {
4881 "name": "findOne",
4882 "object": "collection",
4883 "arguments": {
4884 "timeoutMS": 500,
4885 "filter": {}
4886 }
4887 }
4888 ],
4889 "expectEvents": [
4890 {
4891 "client": "client",
4892 "events": [
4893 {
4894 "commandStartedEvent": {
4895 "commandName": "find",
4896 "databaseName": "test",
4897 "command": {
4898 "find": "coll",
4899 "maxTimeMS": {
4900 "$$type": [
4901 "int",
4902 "long"
4903 ]
4904 }
4905 }
4906 }
4907 },
4908 {
4909 "commandStartedEvent": {
4910 "commandName": "find",
4911 "databaseName": "test",
4912 "command": {
4913 "find": "coll",
4914 "maxTimeMS": {
4915 "$$type": [
4916 "int",
4917 "long"
4918 ]
4919 }
4920 }
4921 }
4922 },
4923 {
4924 "commandStartedEvent": {
4925 "commandName": "find",
4926 "databaseName": "test",
4927 "command": {
4928 "find": "coll",
4929 "maxTimeMS": {
4930 "$$type": [
4931 "int",
4932 "long"
4933 ]
4934 }
4935 }
4936 }
4937 }
4938 ]
4939 }
4940 ]
4941 },
4942 {
4943 "description": "operation is retried multiple times if timeoutMS is zero - findOne on collection",
4944 "operations": [
4945 {
4946 "name": "failPoint",
4947 "object": "testRunner",
4948 "arguments": {
4949 "client": "failPointClient",
4950 "failPoint": {
4951 "configureFailPoint": "failCommand",
4952 "mode": {
4953 "times": 2
4954 },
4955 "data": {
4956 "failCommands": [
4957 "find"
4958 ],
4959 "errorCode": 7,
4960 "closeConnection": false,
4961 "errorLabels": [
4962 "RetryableWriteError"
4963 ]
4964 }
4965 }
4966 }
4967 },
4968 {
4969 "name": "findOne",
4970 "object": "collection",
4971 "arguments": {
4972 "timeoutMS": 0,
4973 "filter": {}
4974 }
4975 }
4976 ],
4977 "expectEvents": [
4978 {
4979 "client": "client",
4980 "events": [
4981 {
4982 "commandStartedEvent": {
4983 "commandName": "find",
4984 "databaseName": "test",
4985 "command": {
4986 "find": "coll",
4987 "maxTimeMS": {
4988 "$$exists": false
4989 }
4990 }
4991 }
4992 },
4993 {
4994 "commandStartedEvent": {
4995 "commandName": "find",
4996 "databaseName": "test",
4997 "command": {
4998 "find": "coll",
4999 "maxTimeMS": {
5000 "$$exists": false
5001 }
5002 }
5003 }
5004 },
5005 {
5006 "commandStartedEvent": {
5007 "commandName": "find",
5008 "databaseName": "test",
5009 "command": {
5010 "find": "coll",
5011 "maxTimeMS": {
5012 "$$exists": false
5013 }
5014 }
5015 }
5016 }
5017 ]
5018 }
5019 ]
5020 },
5021 {
5022 "description": "timeoutMS applies to whole operation, not individual attempts - listIndexes on collection",
5023 "runOnRequirements": [
5024 {
5025 "minServerVersion": "4.4"
5026 }
5027 ],
5028 "operations": [
5029 {
5030 "name": "failPoint",
5031 "object": "testRunner",
5032 "arguments": {
5033 "client": "failPointClient",
5034 "failPoint": {
5035 "configureFailPoint": "failCommand",
5036 "mode": {
5037 "times": 4
5038 },
5039 "data": {
5040 "failCommands": [
5041 "listIndexes"
5042 ],
5043 "blockConnection": true,
5044 "blockTimeMS": 60,
5045 "errorCode": 7,
5046 "errorLabels": [
5047 "RetryableWriteError"
5048 ]
5049 }
5050 }
5051 }
5052 },
5053 {
5054 "name": "listIndexes",
5055 "object": "collection",
5056 "expectError": {
5057 "isTimeoutError": true
5058 }
5059 }
5060 ]
5061 },
5062 {
5063 "description": "operation is retried multiple times for non-zero timeoutMS - listIndexes on collection",
5064 "operations": [
5065 {
5066 "name": "failPoint",
5067 "object": "testRunner",
5068 "arguments": {
5069 "client": "failPointClient",
5070 "failPoint": {
5071 "configureFailPoint": "failCommand",
5072 "mode": {
5073 "times": 2
5074 },
5075 "data": {
5076 "failCommands": [
5077 "listIndexes"
5078 ],
5079 "errorCode": 7,
5080 "closeConnection": false,
5081 "errorLabels": [
5082 "RetryableWriteError"
5083 ]
5084 }
5085 }
5086 }
5087 },
5088 {
5089 "name": "listIndexes",
5090 "object": "collection",
5091 "arguments": {
5092 "timeoutMS": 500
5093 }
5094 }
5095 ],
5096 "expectEvents": [
5097 {
5098 "client": "client",
5099 "events": [
5100 {
5101 "commandStartedEvent": {
5102 "commandName": "listIndexes",
5103 "databaseName": "test",
5104 "command": {
5105 "listIndexes": "coll",
5106 "maxTimeMS": {
5107 "$$type": [
5108 "int",
5109 "long"
5110 ]
5111 }
5112 }
5113 }
5114 },
5115 {
5116 "commandStartedEvent": {
5117 "commandName": "listIndexes",
5118 "databaseName": "test",
5119 "command": {
5120 "listIndexes": "coll",
5121 "maxTimeMS": {
5122 "$$type": [
5123 "int",
5124 "long"
5125 ]
5126 }
5127 }
5128 }
5129 },
5130 {
5131 "commandStartedEvent": {
5132 "commandName": "listIndexes",
5133 "databaseName": "test",
5134 "command": {
5135 "listIndexes": "coll",
5136 "maxTimeMS": {
5137 "$$type": [
5138 "int",
5139 "long"
5140 ]
5141 }
5142 }
5143 }
5144 }
5145 ]
5146 }
5147 ]
5148 },
5149 {
5150 "description": "operation is retried multiple times if timeoutMS is zero - listIndexes on collection",
5151 "operations": [
5152 {
5153 "name": "failPoint",
5154 "object": "testRunner",
5155 "arguments": {
5156 "client": "failPointClient",
5157 "failPoint": {
5158 "configureFailPoint": "failCommand",
5159 "mode": {
5160 "times": 2
5161 },
5162 "data": {
5163 "failCommands": [
5164 "listIndexes"
5165 ],
5166 "errorCode": 7,
5167 "closeConnection": false,
5168 "errorLabels": [
5169 "RetryableWriteError"
5170 ]
5171 }
5172 }
5173 }
5174 },
5175 {
5176 "name": "listIndexes",
5177 "object": "collection",
5178 "arguments": {
5179 "timeoutMS": 0
5180 }
5181 }
5182 ],
5183 "expectEvents": [
5184 {
5185 "client": "client",
5186 "events": [
5187 {
5188 "commandStartedEvent": {
5189 "commandName": "listIndexes",
5190 "databaseName": "test",
5191 "command": {
5192 "listIndexes": "coll",
5193 "maxTimeMS": {
5194 "$$exists": false
5195 }
5196 }
5197 }
5198 },
5199 {
5200 "commandStartedEvent": {
5201 "commandName": "listIndexes",
5202 "databaseName": "test",
5203 "command": {
5204 "listIndexes": "coll",
5205 "maxTimeMS": {
5206 "$$exists": false
5207 }
5208 }
5209 }
5210 },
5211 {
5212 "commandStartedEvent": {
5213 "commandName": "listIndexes",
5214 "databaseName": "test",
5215 "command": {
5216 "listIndexes": "coll",
5217 "maxTimeMS": {
5218 "$$exists": false
5219 }
5220 }
5221 }
5222 }
5223 ]
5224 }
5225 ]
5226 },
5227 {
5228 "description": "timeoutMS applies to whole operation, not individual attempts - createChangeStream on collection",
5229 "runOnRequirements": [
5230 {
5231 "minServerVersion": "4.4"
5232 }
5233 ],
5234 "operations": [
5235 {
5236 "name": "failPoint",
5237 "object": "testRunner",
5238 "arguments": {
5239 "client": "failPointClient",
5240 "failPoint": {
5241 "configureFailPoint": "failCommand",
5242 "mode": {
5243 "times": 4
5244 },
5245 "data": {
5246 "failCommands": [
5247 "aggregate"
5248 ],
5249 "blockConnection": true,
5250 "blockTimeMS": 60,
5251 "errorCode": 7,
5252 "errorLabels": [
5253 "RetryableWriteError"
5254 ]
5255 }
5256 }
5257 }
5258 },
5259 {
5260 "name": "createChangeStream",
5261 "object": "collection",
5262 "arguments": {
5263 "pipeline": []
5264 },
5265 "expectError": {
5266 "isTimeoutError": true
5267 }
5268 }
5269 ]
5270 },
5271 {
5272 "description": "operation is retried multiple times for non-zero timeoutMS - createChangeStream on collection",
5273 "operations": [
5274 {
5275 "name": "failPoint",
5276 "object": "testRunner",
5277 "arguments": {
5278 "client": "failPointClient",
5279 "failPoint": {
5280 "configureFailPoint": "failCommand",
5281 "mode": {
5282 "times": 2
5283 },
5284 "data": {
5285 "failCommands": [
5286 "aggregate"
5287 ],
5288 "errorCode": 7,
5289 "closeConnection": false,
5290 "errorLabels": [
5291 "RetryableWriteError"
5292 ]
5293 }
5294 }
5295 }
5296 },
5297 {
5298 "name": "createChangeStream",
5299 "object": "collection",
5300 "arguments": {
5301 "timeoutMS": 500,
5302 "pipeline": []
5303 }
5304 }
5305 ],
5306 "expectEvents": [
5307 {
5308 "client": "client",
5309 "events": [
5310 {
5311 "commandStartedEvent": {
5312 "commandName": "aggregate",
5313 "databaseName": "test",
5314 "command": {
5315 "aggregate": "coll",
5316 "maxTimeMS": {
5317 "$$type": [
5318 "int",
5319 "long"
5320 ]
5321 }
5322 }
5323 }
5324 },
5325 {
5326 "commandStartedEvent": {
5327 "commandName": "aggregate",
5328 "databaseName": "test",
5329 "command": {
5330 "aggregate": "coll",
5331 "maxTimeMS": {
5332 "$$type": [
5333 "int",
5334 "long"
5335 ]
5336 }
5337 }
5338 }
5339 },
5340 {
5341 "commandStartedEvent": {
5342 "commandName": "aggregate",
5343 "databaseName": "test",
5344 "command": {
5345 "aggregate": "coll",
5346 "maxTimeMS": {
5347 "$$type": [
5348 "int",
5349 "long"
5350 ]
5351 }
5352 }
5353 }
5354 }
5355 ]
5356 }
5357 ]
5358 },
5359 {
5360 "description": "operation is retried multiple times if timeoutMS is zero - createChangeStream on collection",
5361 "operations": [
5362 {
5363 "name": "failPoint",
5364 "object": "testRunner",
5365 "arguments": {
5366 "client": "failPointClient",
5367 "failPoint": {
5368 "configureFailPoint": "failCommand",
5369 "mode": {
5370 "times": 2
5371 },
5372 "data": {
5373 "failCommands": [
5374 "aggregate"
5375 ],
5376 "errorCode": 7,
5377 "closeConnection": false,
5378 "errorLabels": [
5379 "RetryableWriteError"
5380 ]
5381 }
5382 }
5383 }
5384 },
5385 {
5386 "name": "createChangeStream",
5387 "object": "collection",
5388 "arguments": {
5389 "timeoutMS": 0,
5390 "pipeline": []
5391 }
5392 }
5393 ],
5394 "expectEvents": [
5395 {
5396 "client": "client",
5397 "events": [
5398 {
5399 "commandStartedEvent": {
5400 "commandName": "aggregate",
5401 "databaseName": "test",
5402 "command": {
5403 "aggregate": "coll",
5404 "maxTimeMS": {
5405 "$$exists": false
5406 }
5407 }
5408 }
5409 },
5410 {
5411 "commandStartedEvent": {
5412 "commandName": "aggregate",
5413 "databaseName": "test",
5414 "command": {
5415 "aggregate": "coll",
5416 "maxTimeMS": {
5417 "$$exists": false
5418 }
5419 }
5420 }
5421 },
5422 {
5423 "commandStartedEvent": {
5424 "commandName": "aggregate",
5425 "databaseName": "test",
5426 "command": {
5427 "aggregate": "coll",
5428 "maxTimeMS": {
5429 "$$exists": false
5430 }
5431 }
5432 }
5433 }
5434 ]
5435 }
5436 ]
5437 }
5438 ]
5439}
View as plain text