1{
2  "collection_name": "test",
3  "database_name": "change-stream-tests",
4  "tests": [
5    {
6      "description": "change stream resumes after a network error",
7      "minServerVersion": "4.2",
8      "failPoint": {
9        "configureFailPoint": "failCommand",
10        "mode": {
11          "times": 1
12        },
13        "data": {
14          "failCommands": [
15            "getMore"
16          ],
17          "closeConnection": true
18        }
19      },
20      "target": "collection",
21      "topology": [
22        "replicaset",
23        "sharded"
24      ],
25      "changeStreamPipeline": [],
26      "changeStreamOptions": {},
27      "operations": [
28        {
29          "database": "change-stream-tests",
30          "collection": "test",
31          "name": "insertOne",
32          "arguments": {
33            "document": {
34              "x": 1
35            }
36          }
37        }
38      ],
39      "expectations": [
40        {
41          "command_started_event": {
42            "command": {
43              "aggregate": "test",
44              "cursor": {},
45              "pipeline": [
46                {
47                  "$changeStream": {}
48                }
49              ]
50            },
51            "command_name": "aggregate",
52            "database_name": "change-stream-tests"
53          }
54        },
55        {
56          "command_started_event": {
57            "command": {
58              "getMore": 42,
59              "collection": "test"
60            },
61            "command_name": "getMore",
62            "database_name": "change-stream-tests"
63          }
64        },
65        {
66          "command_started_event": {
67            "command": {
68              "aggregate": "test",
69              "cursor": {},
70              "pipeline": [
71                {
72                  "$changeStream": {}
73                }
74              ]
75            },
76            "command_name": "aggregate",
77            "database_name": "change-stream-tests"
78          }
79        }
80      ],
81      "result": {
82        "success": [
83          {
84            "_id": "42",
85            "documentKey": "42",
86            "operationType": "insert",
87            "ns": {
88              "db": "change-stream-tests",
89              "coll": "test"
90            },
91            "fullDocument": {
92              "x": {
93                "$numberInt": "1"
94              }
95            }
96          }
97        ]
98      }
99    },
100    {
101      "description": "change stream resumes after HostUnreachable",
102      "minServerVersion": "4.2",
103      "maxServerVersion": "4.2.99",
104      "failPoint": {
105        "configureFailPoint": "failCommand",
106        "mode": {
107          "times": 1
108        },
109        "data": {
110          "failCommands": [
111            "getMore"
112          ],
113          "errorCode": 6,
114          "closeConnection": false
115        }
116      },
117      "target": "collection",
118      "topology": [
119        "replicaset",
120        "sharded"
121      ],
122      "changeStreamPipeline": [],
123      "changeStreamOptions": {},
124      "operations": [
125        {
126          "database": "change-stream-tests",
127          "collection": "test",
128          "name": "insertOne",
129          "arguments": {
130            "document": {
131              "x": 1
132            }
133          }
134        }
135      ],
136      "expectations": [
137        {
138          "command_started_event": {
139            "command": {
140              "aggregate": "test",
141              "cursor": {},
142              "pipeline": [
143                {
144                  "$changeStream": {}
145                }
146              ]
147            },
148            "command_name": "aggregate",
149            "database_name": "change-stream-tests"
150          }
151        },
152        {
153          "command_started_event": {
154            "command": {
155              "getMore": 42,
156              "collection": "test"
157            },
158            "command_name": "getMore",
159            "database_name": "change-stream-tests"
160          }
161        },
162        {
163          "command_started_event": {
164            "command": {
165              "aggregate": "test",
166              "cursor": {},
167              "pipeline": [
168                {
169                  "$changeStream": {}
170                }
171              ]
172            },
173            "command_name": "aggregate",
174            "database_name": "change-stream-tests"
175          }
176        }
177      ],
178      "result": {
179        "success": [
180          {
181            "_id": "42",
182            "documentKey": "42",
183            "operationType": "insert",
184            "ns": {
185              "db": "change-stream-tests",
186              "coll": "test"
187            },
188            "fullDocument": {
189              "x": {
190                "$numberInt": "1"
191              }
192            }
193          }
194        ]
195      }
196    },
197    {
198      "description": "change stream resumes after HostNotFound",
199      "minServerVersion": "4.2",
200      "maxServerVersion": "4.2.99",
201      "failPoint": {
202        "configureFailPoint": "failCommand",
203        "mode": {
204          "times": 1
205        },
206        "data": {
207          "failCommands": [
208            "getMore"
209          ],
210          "errorCode": 7,
211          "closeConnection": false
212        }
213      },
214      "target": "collection",
215      "topology": [
216        "replicaset",
217        "sharded"
218      ],
219      "changeStreamPipeline": [],
220      "changeStreamOptions": {},
221      "operations": [
222        {
223          "database": "change-stream-tests",
224          "collection": "test",
225          "name": "insertOne",
226          "arguments": {
227            "document": {
228              "x": 1
229            }
230          }
231        }
232      ],
233      "expectations": [
234        {
235          "command_started_event": {
236            "command": {
237              "aggregate": "test",
238              "cursor": {},
239              "pipeline": [
240                {
241                  "$changeStream": {}
242                }
243              ]
244            },
245            "command_name": "aggregate",
246            "database_name": "change-stream-tests"
247          }
248        },
249        {
250          "command_started_event": {
251            "command": {
252              "getMore": 42,
253              "collection": "test"
254            },
255            "command_name": "getMore",
256            "database_name": "change-stream-tests"
257          }
258        },
259        {
260          "command_started_event": {
261            "command": {
262              "aggregate": "test",
263              "cursor": {},
264              "pipeline": [
265                {
266                  "$changeStream": {}
267                }
268              ]
269            },
270            "command_name": "aggregate",
271            "database_name": "change-stream-tests"
272          }
273        }
274      ],
275      "result": {
276        "success": [
277          {
278            "_id": "42",
279            "documentKey": "42",
280            "operationType": "insert",
281            "ns": {
282              "db": "change-stream-tests",
283              "coll": "test"
284            },
285            "fullDocument": {
286              "x": {
287                "$numberInt": "1"
288              }
289            }
290          }
291        ]
292      }
293    },
294    {
295      "description": "change stream resumes after NetworkTimeout",
296      "minServerVersion": "4.2",
297      "maxServerVersion": "4.2.99",
298      "failPoint": {
299        "configureFailPoint": "failCommand",
300        "mode": {
301          "times": 1
302        },
303        "data": {
304          "failCommands": [
305            "getMore"
306          ],
307          "errorCode": 89,
308          "closeConnection": false
309        }
310      },
311      "target": "collection",
312      "topology": [
313        "replicaset",
314        "sharded"
315      ],
316      "changeStreamPipeline": [],
317      "changeStreamOptions": {},
318      "operations": [
319        {
320          "database": "change-stream-tests",
321          "collection": "test",
322          "name": "insertOne",
323          "arguments": {
324            "document": {
325              "x": 1
326            }
327          }
328        }
329      ],
330      "expectations": [
331        {
332          "command_started_event": {
333            "command": {
334              "aggregate": "test",
335              "cursor": {},
336              "pipeline": [
337                {
338                  "$changeStream": {}
339                }
340              ]
341            },
342            "command_name": "aggregate",
343            "database_name": "change-stream-tests"
344          }
345        },
346        {
347          "command_started_event": {
348            "command": {
349              "getMore": 42,
350              "collection": "test"
351            },
352            "command_name": "getMore",
353            "database_name": "change-stream-tests"
354          }
355        },
356        {
357          "command_started_event": {
358            "command": {
359              "aggregate": "test",
360              "cursor": {},
361              "pipeline": [
362                {
363                  "$changeStream": {}
364                }
365              ]
366            },
367            "command_name": "aggregate",
368            "database_name": "change-stream-tests"
369          }
370        }
371      ],
372      "result": {
373        "success": [
374          {
375            "_id": "42",
376            "documentKey": "42",
377            "operationType": "insert",
378            "ns": {
379              "db": "change-stream-tests",
380              "coll": "test"
381            },
382            "fullDocument": {
383              "x": {
384                "$numberInt": "1"
385              }
386            }
387          }
388        ]
389      }
390    },
391    {
392      "description": "change stream resumes after ShutdownInProgress",
393      "minServerVersion": "4.2",
394      "maxServerVersion": "4.2.99",
395      "failPoint": {
396        "configureFailPoint": "failCommand",
397        "mode": {
398          "times": 1
399        },
400        "data": {
401          "failCommands": [
402            "getMore"
403          ],
404          "errorCode": 91,
405          "closeConnection": false
406        }
407      },
408      "target": "collection",
409      "topology": [
410        "replicaset",
411        "sharded"
412      ],
413      "changeStreamPipeline": [],
414      "changeStreamOptions": {},
415      "operations": [
416        {
417          "database": "change-stream-tests",
418          "collection": "test",
419          "name": "insertOne",
420          "arguments": {
421            "document": {
422              "x": 1
423            }
424          }
425        }
426      ],
427      "expectations": [
428        {
429          "command_started_event": {
430            "command": {
431              "aggregate": "test",
432              "cursor": {},
433              "pipeline": [
434                {
435                  "$changeStream": {}
436                }
437              ]
438            },
439            "command_name": "aggregate",
440            "database_name": "change-stream-tests"
441          }
442        },
443        {
444          "command_started_event": {
445            "command": {
446              "getMore": 42,
447              "collection": "test"
448            },
449            "command_name": "getMore",
450            "database_name": "change-stream-tests"
451          }
452        },
453        {
454          "command_started_event": {
455            "command": {
456              "aggregate": "test",
457              "cursor": {},
458              "pipeline": [
459                {
460                  "$changeStream": {}
461                }
462              ]
463            },
464            "command_name": "aggregate",
465            "database_name": "change-stream-tests"
466          }
467        }
468      ],
469      "result": {
470        "success": [
471          {
472            "_id": "42",
473            "documentKey": "42",
474            "operationType": "insert",
475            "ns": {
476              "db": "change-stream-tests",
477              "coll": "test"
478            },
479            "fullDocument": {
480              "x": {
481                "$numberInt": "1"
482              }
483            }
484          }
485        ]
486      }
487    },
488    {
489      "description": "change stream resumes after PrimarySteppedDown",
490      "minServerVersion": "4.2",
491      "maxServerVersion": "4.2.99",
492      "failPoint": {
493        "configureFailPoint": "failCommand",
494        "mode": {
495          "times": 1
496        },
497        "data": {
498          "failCommands": [
499            "getMore"
500          ],
501          "errorCode": 189,
502          "closeConnection": false
503        }
504      },
505      "target": "collection",
506      "topology": [
507        "replicaset",
508        "sharded"
509      ],
510      "changeStreamPipeline": [],
511      "changeStreamOptions": {},
512      "operations": [
513        {
514          "database": "change-stream-tests",
515          "collection": "test",
516          "name": "insertOne",
517          "arguments": {
518            "document": {
519              "x": 1
520            }
521          }
522        }
523      ],
524      "expectations": [
525        {
526          "command_started_event": {
527            "command": {
528              "aggregate": "test",
529              "cursor": {},
530              "pipeline": [
531                {
532                  "$changeStream": {}
533                }
534              ]
535            },
536            "command_name": "aggregate",
537            "database_name": "change-stream-tests"
538          }
539        },
540        {
541          "command_started_event": {
542            "command": {
543              "getMore": 42,
544              "collection": "test"
545            },
546            "command_name": "getMore",
547            "database_name": "change-stream-tests"
548          }
549        },
550        {
551          "command_started_event": {
552            "command": {
553              "aggregate": "test",
554              "cursor": {},
555              "pipeline": [
556                {
557                  "$changeStream": {}
558                }
559              ]
560            },
561            "command_name": "aggregate",
562            "database_name": "change-stream-tests"
563          }
564        }
565      ],
566      "result": {
567        "success": [
568          {
569            "_id": "42",
570            "documentKey": "42",
571            "operationType": "insert",
572            "ns": {
573              "db": "change-stream-tests",
574              "coll": "test"
575            },
576            "fullDocument": {
577              "x": {
578                "$numberInt": "1"
579              }
580            }
581          }
582        ]
583      }
584    },
585    {
586      "description": "change stream resumes after ExceededTimeLimit",
587      "minServerVersion": "4.2",
588      "maxServerVersion": "4.2.99",
589      "failPoint": {
590        "configureFailPoint": "failCommand",
591        "mode": {
592          "times": 1
593        },
594        "data": {
595          "failCommands": [
596            "getMore"
597          ],
598          "errorCode": 262,
599          "closeConnection": false
600        }
601      },
602      "target": "collection",
603      "topology": [
604        "replicaset",
605        "sharded"
606      ],
607      "changeStreamPipeline": [],
608      "changeStreamOptions": {},
609      "operations": [
610        {
611          "database": "change-stream-tests",
612          "collection": "test",
613          "name": "insertOne",
614          "arguments": {
615            "document": {
616              "x": 1
617            }
618          }
619        }
620      ],
621      "expectations": [
622        {
623          "command_started_event": {
624            "command": {
625              "aggregate": "test",
626              "cursor": {},
627              "pipeline": [
628                {
629                  "$changeStream": {}
630                }
631              ]
632            },
633            "command_name": "aggregate",
634            "database_name": "change-stream-tests"
635          }
636        },
637        {
638          "command_started_event": {
639            "command": {
640              "getMore": 42,
641              "collection": "test"
642            },
643            "command_name": "getMore",
644            "database_name": "change-stream-tests"
645          }
646        },
647        {
648          "command_started_event": {
649            "command": {
650              "aggregate": "test",
651              "cursor": {},
652              "pipeline": [
653                {
654                  "$changeStream": {}
655                }
656              ]
657            },
658            "command_name": "aggregate",
659            "database_name": "change-stream-tests"
660          }
661        }
662      ],
663      "result": {
664        "success": [
665          {
666            "_id": "42",
667            "documentKey": "42",
668            "operationType": "insert",
669            "ns": {
670              "db": "change-stream-tests",
671              "coll": "test"
672            },
673            "fullDocument": {
674              "x": {
675                "$numberInt": "1"
676              }
677            }
678          }
679        ]
680      }
681    },
682    {
683      "description": "change stream resumes after SocketException",
684      "minServerVersion": "4.2",
685      "maxServerVersion": "4.2.99",
686      "failPoint": {
687        "configureFailPoint": "failCommand",
688        "mode": {
689          "times": 1
690        },
691        "data": {
692          "failCommands": [
693            "getMore"
694          ],
695          "errorCode": 9001,
696          "closeConnection": false
697        }
698      },
699      "target": "collection",
700      "topology": [
701        "replicaset",
702        "sharded"
703      ],
704      "changeStreamPipeline": [],
705      "changeStreamOptions": {},
706      "operations": [
707        {
708          "database": "change-stream-tests",
709          "collection": "test",
710          "name": "insertOne",
711          "arguments": {
712            "document": {
713              "x": 1
714            }
715          }
716        }
717      ],
718      "expectations": [
719        {
720          "command_started_event": {
721            "command": {
722              "aggregate": "test",
723              "cursor": {},
724              "pipeline": [
725                {
726                  "$changeStream": {}
727                }
728              ]
729            },
730            "command_name": "aggregate",
731            "database_name": "change-stream-tests"
732          }
733        },
734        {
735          "command_started_event": {
736            "command": {
737              "getMore": 42,
738              "collection": "test"
739            },
740            "command_name": "getMore",
741            "database_name": "change-stream-tests"
742          }
743        },
744        {
745          "command_started_event": {
746            "command": {
747              "aggregate": "test",
748              "cursor": {},
749              "pipeline": [
750                {
751                  "$changeStream": {}
752                }
753              ]
754            },
755            "command_name": "aggregate",
756            "database_name": "change-stream-tests"
757          }
758        }
759      ],
760      "result": {
761        "success": [
762          {
763            "_id": "42",
764            "documentKey": "42",
765            "operationType": "insert",
766            "ns": {
767              "db": "change-stream-tests",
768              "coll": "test"
769            },
770            "fullDocument": {
771              "x": {
772                "$numberInt": "1"
773              }
774            }
775          }
776        ]
777      }
778    },
779    {
780      "description": "change stream resumes after NotMaster",
781      "minServerVersion": "4.2",
782      "maxServerVersion": "4.2.99",
783      "failPoint": {
784        "configureFailPoint": "failCommand",
785        "mode": {
786          "times": 1
787        },
788        "data": {
789          "failCommands": [
790            "getMore"
791          ],
792          "errorCode": 10107,
793          "closeConnection": false
794        }
795      },
796      "target": "collection",
797      "topology": [
798        "replicaset",
799        "sharded"
800      ],
801      "changeStreamPipeline": [],
802      "changeStreamOptions": {},
803      "operations": [
804        {
805          "database": "change-stream-tests",
806          "collection": "test",
807          "name": "insertOne",
808          "arguments": {
809            "document": {
810              "x": 1
811            }
812          }
813        }
814      ],
815      "expectations": [
816        {
817          "command_started_event": {
818            "command": {
819              "aggregate": "test",
820              "cursor": {},
821              "pipeline": [
822                {
823                  "$changeStream": {}
824                }
825              ]
826            },
827            "command_name": "aggregate",
828            "database_name": "change-stream-tests"
829          }
830        },
831        {
832          "command_started_event": {
833            "command": {
834              "getMore": 42,
835              "collection": "test"
836            },
837            "command_name": "getMore",
838            "database_name": "change-stream-tests"
839          }
840        },
841        {
842          "command_started_event": {
843            "command": {
844              "aggregate": "test",
845              "cursor": {},
846              "pipeline": [
847                {
848                  "$changeStream": {}
849                }
850              ]
851            },
852            "command_name": "aggregate",
853            "database_name": "change-stream-tests"
854          }
855        }
856      ],
857      "result": {
858        "success": [
859          {
860            "_id": "42",
861            "documentKey": "42",
862            "operationType": "insert",
863            "ns": {
864              "db": "change-stream-tests",
865              "coll": "test"
866            },
867            "fullDocument": {
868              "x": {
869                "$numberInt": "1"
870              }
871            }
872          }
873        ]
874      }
875    },
876    {
877      "description": "change stream resumes after InterruptedAtShutdown",
878      "minServerVersion": "4.2",
879      "maxServerVersion": "4.2.99",
880      "failPoint": {
881        "configureFailPoint": "failCommand",
882        "mode": {
883          "times": 1
884        },
885        "data": {
886          "failCommands": [
887            "getMore"
888          ],
889          "errorCode": 11600,
890          "closeConnection": false
891        }
892      },
893      "target": "collection",
894      "topology": [
895        "replicaset",
896        "sharded"
897      ],
898      "changeStreamPipeline": [],
899      "changeStreamOptions": {},
900      "operations": [
901        {
902          "database": "change-stream-tests",
903          "collection": "test",
904          "name": "insertOne",
905          "arguments": {
906            "document": {
907              "x": 1
908            }
909          }
910        }
911      ],
912      "expectations": [
913        {
914          "command_started_event": {
915            "command": {
916              "aggregate": "test",
917              "cursor": {},
918              "pipeline": [
919                {
920                  "$changeStream": {}
921                }
922              ]
923            },
924            "command_name": "aggregate",
925            "database_name": "change-stream-tests"
926          }
927        },
928        {
929          "command_started_event": {
930            "command": {
931              "getMore": 42,
932              "collection": "test"
933            },
934            "command_name": "getMore",
935            "database_name": "change-stream-tests"
936          }
937        },
938        {
939          "command_started_event": {
940            "command": {
941              "aggregate": "test",
942              "cursor": {},
943              "pipeline": [
944                {
945                  "$changeStream": {}
946                }
947              ]
948            },
949            "command_name": "aggregate",
950            "database_name": "change-stream-tests"
951          }
952        }
953      ],
954      "result": {
955        "success": [
956          {
957            "_id": "42",
958            "documentKey": "42",
959            "operationType": "insert",
960            "ns": {
961              "db": "change-stream-tests",
962              "coll": "test"
963            },
964            "fullDocument": {
965              "x": {
966                "$numberInt": "1"
967              }
968            }
969          }
970        ]
971      }
972    },
973    {
974      "description": "change stream resumes after InterruptedDueToReplStateChange",
975      "minServerVersion": "4.2",
976      "maxServerVersion": "4.2.99",
977      "failPoint": {
978        "configureFailPoint": "failCommand",
979        "mode": {
980          "times": 1
981        },
982        "data": {
983          "failCommands": [
984            "getMore"
985          ],
986          "errorCode": 11602,
987          "closeConnection": false
988        }
989      },
990      "target": "collection",
991      "topology": [
992        "replicaset",
993        "sharded"
994      ],
995      "changeStreamPipeline": [],
996      "changeStreamOptions": {},
997      "operations": [
998        {
999          "database": "change-stream-tests",
1000          "collection": "test",
1001          "name": "insertOne",
1002          "arguments": {
1003            "document": {
1004              "x": 1
1005            }
1006          }
1007        }
1008      ],
1009      "expectations": [
1010        {
1011          "command_started_event": {
1012            "command": {
1013              "aggregate": "test",
1014              "cursor": {},
1015              "pipeline": [
1016                {
1017                  "$changeStream": {}
1018                }
1019              ]
1020            },
1021            "command_name": "aggregate",
1022            "database_name": "change-stream-tests"
1023          }
1024        },
1025        {
1026          "command_started_event": {
1027            "command": {
1028              "getMore": 42,
1029              "collection": "test"
1030            },
1031            "command_name": "getMore",
1032            "database_name": "change-stream-tests"
1033          }
1034        },
1035        {
1036          "command_started_event": {
1037            "command": {
1038              "aggregate": "test",
1039              "cursor": {},
1040              "pipeline": [
1041                {
1042                  "$changeStream": {}
1043                }
1044              ]
1045            },
1046            "command_name": "aggregate",
1047            "database_name": "change-stream-tests"
1048          }
1049        }
1050      ],
1051      "result": {
1052        "success": [
1053          {
1054            "_id": "42",
1055            "documentKey": "42",
1056            "operationType": "insert",
1057            "ns": {
1058              "db": "change-stream-tests",
1059              "coll": "test"
1060            },
1061            "fullDocument": {
1062              "x": {
1063                "$numberInt": "1"
1064              }
1065            }
1066          }
1067        ]
1068      }
1069    },
1070    {
1071      "description": "change stream resumes after NotMasterNoSlaveOk",
1072      "minServerVersion": "4.2",
1073      "maxServerVersion": "4.2.99",
1074      "failPoint": {
1075        "configureFailPoint": "failCommand",
1076        "mode": {
1077          "times": 1
1078        },
1079        "data": {
1080          "failCommands": [
1081            "getMore"
1082          ],
1083          "errorCode": 13435,
1084          "closeConnection": false
1085        }
1086      },
1087      "target": "collection",
1088      "topology": [
1089        "replicaset",
1090        "sharded"
1091      ],
1092      "changeStreamPipeline": [],
1093      "changeStreamOptions": {},
1094      "operations": [
1095        {
1096          "database": "change-stream-tests",
1097          "collection": "test",
1098          "name": "insertOne",
1099          "arguments": {
1100            "document": {
1101              "x": 1
1102            }
1103          }
1104        }
1105      ],
1106      "expectations": [
1107        {
1108          "command_started_event": {
1109            "command": {
1110              "aggregate": "test",
1111              "cursor": {},
1112              "pipeline": [
1113                {
1114                  "$changeStream": {}
1115                }
1116              ]
1117            },
1118            "command_name": "aggregate",
1119            "database_name": "change-stream-tests"
1120          }
1121        },
1122        {
1123          "command_started_event": {
1124            "command": {
1125              "getMore": 42,
1126              "collection": "test"
1127            },
1128            "command_name": "getMore",
1129            "database_name": "change-stream-tests"
1130          }
1131        },
1132        {
1133          "command_started_event": {
1134            "command": {
1135              "aggregate": "test",
1136              "cursor": {},
1137              "pipeline": [
1138                {
1139                  "$changeStream": {}
1140                }
1141              ]
1142            },
1143            "command_name": "aggregate",
1144            "database_name": "change-stream-tests"
1145          }
1146        }
1147      ],
1148      "result": {
1149        "success": [
1150          {
1151            "_id": "42",
1152            "documentKey": "42",
1153            "operationType": "insert",
1154            "ns": {
1155              "db": "change-stream-tests",
1156              "coll": "test"
1157            },
1158            "fullDocument": {
1159              "x": {
1160                "$numberInt": "1"
1161              }
1162            }
1163          }
1164        ]
1165      }
1166    },
1167    {
1168      "description": "change stream resumes after NotMasterOrSecondary",
1169      "minServerVersion": "4.2",
1170      "maxServerVersion": "4.2.99",
1171      "failPoint": {
1172        "configureFailPoint": "failCommand",
1173        "mode": {
1174          "times": 1
1175        },
1176        "data": {
1177          "failCommands": [
1178            "getMore"
1179          ],
1180          "errorCode": 13436,
1181          "closeConnection": false
1182        }
1183      },
1184      "target": "collection",
1185      "topology": [
1186        "replicaset",
1187        "sharded"
1188      ],
1189      "changeStreamPipeline": [],
1190      "changeStreamOptions": {},
1191      "operations": [
1192        {
1193          "database": "change-stream-tests",
1194          "collection": "test",
1195          "name": "insertOne",
1196          "arguments": {
1197            "document": {
1198              "x": 1
1199            }
1200          }
1201        }
1202      ],
1203      "expectations": [
1204        {
1205          "command_started_event": {
1206            "command": {
1207              "aggregate": "test",
1208              "cursor": {},
1209              "pipeline": [
1210                {
1211                  "$changeStream": {}
1212                }
1213              ]
1214            },
1215            "command_name": "aggregate",
1216            "database_name": "change-stream-tests"
1217          }
1218        },
1219        {
1220          "command_started_event": {
1221            "command": {
1222              "getMore": 42,
1223              "collection": "test"
1224            },
1225            "command_name": "getMore",
1226            "database_name": "change-stream-tests"
1227          }
1228        },
1229        {
1230          "command_started_event": {
1231            "command": {
1232              "aggregate": "test",
1233              "cursor": {},
1234              "pipeline": [
1235                {
1236                  "$changeStream": {}
1237                }
1238              ]
1239            },
1240            "command_name": "aggregate",
1241            "database_name": "change-stream-tests"
1242          }
1243        }
1244      ],
1245      "result": {
1246        "success": [
1247          {
1248            "_id": "42",
1249            "documentKey": "42",
1250            "operationType": "insert",
1251            "ns": {
1252              "db": "change-stream-tests",
1253              "coll": "test"
1254            },
1255            "fullDocument": {
1256              "x": {
1257                "$numberInt": "1"
1258              }
1259            }
1260          }
1261        ]
1262      }
1263    },
1264    {
1265      "description": "change stream resumes after StaleShardVersion",
1266      "minServerVersion": "4.2",
1267      "maxServerVersion": "4.2.99",
1268      "failPoint": {
1269        "configureFailPoint": "failCommand",
1270        "mode": {
1271          "times": 1
1272        },
1273        "data": {
1274          "failCommands": [
1275            "getMore"
1276          ],
1277          "errorCode": 63,
1278          "closeConnection": false
1279        }
1280      },
1281      "target": "collection",
1282      "topology": [
1283        "replicaset",
1284        "sharded"
1285      ],
1286      "changeStreamPipeline": [],
1287      "changeStreamOptions": {},
1288      "operations": [
1289        {
1290          "database": "change-stream-tests",
1291          "collection": "test",
1292          "name": "insertOne",
1293          "arguments": {
1294            "document": {
1295              "x": 1
1296            }
1297          }
1298        }
1299      ],
1300      "expectations": [
1301        {
1302          "command_started_event": {
1303            "command": {
1304              "aggregate": "test",
1305              "cursor": {},
1306              "pipeline": [
1307                {
1308                  "$changeStream": {}
1309                }
1310              ]
1311            },
1312            "command_name": "aggregate",
1313            "database_name": "change-stream-tests"
1314          }
1315        },
1316        {
1317          "command_started_event": {
1318            "command": {
1319              "getMore": 42,
1320              "collection": "test"
1321            },
1322            "command_name": "getMore",
1323            "database_name": "change-stream-tests"
1324          }
1325        },
1326        {
1327          "command_started_event": {
1328            "command": {
1329              "aggregate": "test",
1330              "cursor": {},
1331              "pipeline": [
1332                {
1333                  "$changeStream": {}
1334                }
1335              ]
1336            },
1337            "command_name": "aggregate",
1338            "database_name": "change-stream-tests"
1339          }
1340        }
1341      ],
1342      "result": {
1343        "success": [
1344          {
1345            "_id": "42",
1346            "documentKey": "42",
1347            "operationType": "insert",
1348            "ns": {
1349              "db": "change-stream-tests",
1350              "coll": "test"
1351            },
1352            "fullDocument": {
1353              "x": {
1354                "$numberInt": "1"
1355              }
1356            }
1357          }
1358        ]
1359      }
1360    },
1361    {
1362      "description": "change stream resumes after StaleEpoch",
1363      "minServerVersion": "4.2",
1364      "maxServerVersion": "4.2.99",
1365      "failPoint": {
1366        "configureFailPoint": "failCommand",
1367        "mode": {
1368          "times": 1
1369        },
1370        "data": {
1371          "failCommands": [
1372            "getMore"
1373          ],
1374          "errorCode": 150,
1375          "closeConnection": false
1376        }
1377      },
1378      "target": "collection",
1379      "topology": [
1380        "replicaset",
1381        "sharded"
1382      ],
1383      "changeStreamPipeline": [],
1384      "changeStreamOptions": {},
1385      "operations": [
1386        {
1387          "database": "change-stream-tests",
1388          "collection": "test",
1389          "name": "insertOne",
1390          "arguments": {
1391            "document": {
1392              "x": 1
1393            }
1394          }
1395        }
1396      ],
1397      "expectations": [
1398        {
1399          "command_started_event": {
1400            "command": {
1401              "aggregate": "test",
1402              "cursor": {},
1403              "pipeline": [
1404                {
1405                  "$changeStream": {}
1406                }
1407              ]
1408            },
1409            "command_name": "aggregate",
1410            "database_name": "change-stream-tests"
1411          }
1412        },
1413        {
1414          "command_started_event": {
1415            "command": {
1416              "getMore": 42,
1417              "collection": "test"
1418            },
1419            "command_name": "getMore",
1420            "database_name": "change-stream-tests"
1421          }
1422        },
1423        {
1424          "command_started_event": {
1425            "command": {
1426              "aggregate": "test",
1427              "cursor": {},
1428              "pipeline": [
1429                {
1430                  "$changeStream": {}
1431                }
1432              ]
1433            },
1434            "command_name": "aggregate",
1435            "database_name": "change-stream-tests"
1436          }
1437        }
1438      ],
1439      "result": {
1440        "success": [
1441          {
1442            "_id": "42",
1443            "documentKey": "42",
1444            "operationType": "insert",
1445            "ns": {
1446              "db": "change-stream-tests",
1447              "coll": "test"
1448            },
1449            "fullDocument": {
1450              "x": {
1451                "$numberInt": "1"
1452              }
1453            }
1454          }
1455        ]
1456      }
1457    },
1458    {
1459      "description": "change stream resumes after RetryChangeStream",
1460      "minServerVersion": "4.2",
1461      "maxServerVersion": "4.2.99",
1462      "failPoint": {
1463        "configureFailPoint": "failCommand",
1464        "mode": {
1465          "times": 1
1466        },
1467        "data": {
1468          "failCommands": [
1469            "getMore"
1470          ],
1471          "errorCode": 234,
1472          "closeConnection": false
1473        }
1474      },
1475      "target": "collection",
1476      "topology": [
1477        "replicaset",
1478        "sharded"
1479      ],
1480      "changeStreamPipeline": [],
1481      "changeStreamOptions": {},
1482      "operations": [
1483        {
1484          "database": "change-stream-tests",
1485          "collection": "test",
1486          "name": "insertOne",
1487          "arguments": {
1488            "document": {
1489              "x": 1
1490            }
1491          }
1492        }
1493      ],
1494      "expectations": [
1495        {
1496          "command_started_event": {
1497            "command": {
1498              "aggregate": "test",
1499              "cursor": {},
1500              "pipeline": [
1501                {
1502                  "$changeStream": {}
1503                }
1504              ]
1505            },
1506            "command_name": "aggregate",
1507            "database_name": "change-stream-tests"
1508          }
1509        },
1510        {
1511          "command_started_event": {
1512            "command": {
1513              "getMore": 42,
1514              "collection": "test"
1515            },
1516            "command_name": "getMore",
1517            "database_name": "change-stream-tests"
1518          }
1519        },
1520        {
1521          "command_started_event": {
1522            "command": {
1523              "aggregate": "test",
1524              "cursor": {},
1525              "pipeline": [
1526                {
1527                  "$changeStream": {}
1528                }
1529              ]
1530            },
1531            "command_name": "aggregate",
1532            "database_name": "change-stream-tests"
1533          }
1534        }
1535      ],
1536      "result": {
1537        "success": [
1538          {
1539            "_id": "42",
1540            "documentKey": "42",
1541            "operationType": "insert",
1542            "ns": {
1543              "db": "change-stream-tests",
1544              "coll": "test"
1545            },
1546            "fullDocument": {
1547              "x": {
1548                "$numberInt": "1"
1549              }
1550            }
1551          }
1552        ]
1553      }
1554    },
1555    {
1556      "description": "change stream resumes after FailedToSatisfyReadPreference",
1557      "minServerVersion": "4.2",
1558      "maxServerVersion": "4.2.99",
1559      "failPoint": {
1560        "configureFailPoint": "failCommand",
1561        "mode": {
1562          "times": 1
1563        },
1564        "data": {
1565          "failCommands": [
1566            "getMore"
1567          ],
1568          "errorCode": 133,
1569          "closeConnection": false
1570        }
1571      },
1572      "target": "collection",
1573      "topology": [
1574        "replicaset",
1575        "sharded"
1576      ],
1577      "changeStreamPipeline": [],
1578      "changeStreamOptions": {},
1579      "operations": [
1580        {
1581          "database": "change-stream-tests",
1582          "collection": "test",
1583          "name": "insertOne",
1584          "arguments": {
1585            "document": {
1586              "x": 1
1587            }
1588          }
1589        }
1590      ],
1591      "expectations": [
1592        {
1593          "command_started_event": {
1594            "command": {
1595              "aggregate": "test",
1596              "cursor": {},
1597              "pipeline": [
1598                {
1599                  "$changeStream": {}
1600                }
1601              ]
1602            },
1603            "command_name": "aggregate",
1604            "database_name": "change-stream-tests"
1605          }
1606        },
1607        {
1608          "command_started_event": {
1609            "command": {
1610              "getMore": 42,
1611              "collection": "test"
1612            },
1613            "command_name": "getMore",
1614            "database_name": "change-stream-tests"
1615          }
1616        },
1617        {
1618          "command_started_event": {
1619            "command": {
1620              "aggregate": "test",
1621              "cursor": {},
1622              "pipeline": [
1623                {
1624                  "$changeStream": {}
1625                }
1626              ]
1627            },
1628            "command_name": "aggregate",
1629            "database_name": "change-stream-tests"
1630          }
1631        }
1632      ],
1633      "result": {
1634        "success": [
1635          {
1636            "_id": "42",
1637            "documentKey": "42",
1638            "operationType": "insert",
1639            "ns": {
1640              "db": "change-stream-tests",
1641              "coll": "test"
1642            },
1643            "fullDocument": {
1644              "x": {
1645                "$numberInt": "1"
1646              }
1647            }
1648          }
1649        ]
1650      }
1651    },
1652    {
1653      "description": "change stream resumes after CursorNotFound",
1654      "minServerVersion": "4.2",
1655      "failPoint": {
1656        "configureFailPoint": "failCommand",
1657        "mode": {
1658          "times": 1
1659        },
1660        "data": {
1661          "failCommands": [
1662            "getMore"
1663          ],
1664          "errorCode": 43,
1665          "closeConnection": false
1666        }
1667      },
1668      "target": "collection",
1669      "topology": [
1670        "replicaset",
1671        "sharded"
1672      ],
1673      "changeStreamPipeline": [],
1674      "changeStreamOptions": {},
1675      "operations": [
1676        {
1677          "database": "change-stream-tests",
1678          "collection": "test",
1679          "name": "insertOne",
1680          "arguments": {
1681            "document": {
1682              "x": 1
1683            }
1684          }
1685        }
1686      ],
1687      "expectations": [
1688        {
1689          "command_started_event": {
1690            "command": {
1691              "aggregate": "test",
1692              "cursor": {},
1693              "pipeline": [
1694                {
1695                  "$changeStream": {}
1696                }
1697              ]
1698            },
1699            "command_name": "aggregate",
1700            "database_name": "change-stream-tests"
1701          }
1702        },
1703        {
1704          "command_started_event": {
1705            "command": {
1706              "getMore": 42,
1707              "collection": "test"
1708            },
1709            "command_name": "getMore",
1710            "database_name": "change-stream-tests"
1711          }
1712        },
1713        {
1714          "command_started_event": {
1715            "command": {
1716              "aggregate": "test",
1717              "cursor": {},
1718              "pipeline": [
1719                {
1720                  "$changeStream": {}
1721                }
1722              ]
1723            },
1724            "command_name": "aggregate",
1725            "database_name": "change-stream-tests"
1726          }
1727        }
1728      ],
1729      "result": {
1730        "success": [
1731          {
1732            "_id": "42",
1733            "documentKey": "42",
1734            "operationType": "insert",
1735            "ns": {
1736              "db": "change-stream-tests",
1737              "coll": "test"
1738            },
1739            "fullDocument": {
1740              "x": {
1741                "$numberInt": "1"
1742              }
1743            }
1744          }
1745        ]
1746      }
1747    }
1748  ]
1749}
1750