...

Text file src/go.mongodb.org/mongo-driver/testdata/retryable-reads/changeStreams-db.watch-serverErrors.json

Documentation: go.mongodb.org/mongo-driver/testdata/retryable-reads

     1{
     2  "runOn": [
     3    {
     4      "minServerVersion": "4.0",
     5      "topology": [
     6        "replicaset"
     7      ]
     8    },
     9    {
    10      "minServerVersion": "4.1.7",
    11      "topology": [
    12        "sharded",
    13        "load-balanced"
    14      ],
    15      "serverless": "forbid"
    16    }
    17  ],
    18  "database_name": "retryable-reads-tests",
    19  "collection_name": "coll",
    20  "data": [
    21    {
    22      "_id": 1,
    23      "x": 11
    24    },
    25    {
    26      "_id": 2,
    27      "x": 22
    28    },
    29    {
    30      "_id": 3,
    31      "x": 33
    32    }
    33  ],
    34  "tests": [
    35    {
    36      "description": "db.watch succeeds after InterruptedAtShutdown",
    37      "failPoint": {
    38        "configureFailPoint": "failCommand",
    39        "mode": {
    40          "times": 1
    41        },
    42        "data": {
    43          "failCommands": [
    44            "aggregate"
    45          ],
    46          "errorCode": 11600
    47        }
    48      },
    49      "operations": [
    50        {
    51          "name": "watch",
    52          "object": "database"
    53        }
    54      ],
    55      "expectations": [
    56        {
    57          "command_started_event": {
    58            "command": {
    59              "aggregate": 1,
    60              "cursor": {},
    61              "pipeline": [
    62                {
    63                  "$changeStream": {}
    64                }
    65              ]
    66            },
    67            "database_name": "retryable-reads-tests"
    68          }
    69        },
    70        {
    71          "command_started_event": {
    72            "command": {
    73              "aggregate": 1,
    74              "cursor": {},
    75              "pipeline": [
    76                {
    77                  "$changeStream": {}
    78                }
    79              ]
    80            },
    81            "database_name": "retryable-reads-tests"
    82          }
    83        }
    84      ]
    85    },
    86    {
    87      "description": "db.watch succeeds after InterruptedDueToReplStateChange",
    88      "failPoint": {
    89        "configureFailPoint": "failCommand",
    90        "mode": {
    91          "times": 1
    92        },
    93        "data": {
    94          "failCommands": [
    95            "aggregate"
    96          ],
    97          "errorCode": 11602
    98        }
    99      },
   100      "operations": [
   101        {
   102          "name": "watch",
   103          "object": "database"
   104        }
   105      ],
   106      "expectations": [
   107        {
   108          "command_started_event": {
   109            "command": {
   110              "aggregate": 1,
   111              "cursor": {},
   112              "pipeline": [
   113                {
   114                  "$changeStream": {}
   115                }
   116              ]
   117            },
   118            "database_name": "retryable-reads-tests"
   119          }
   120        },
   121        {
   122          "command_started_event": {
   123            "command": {
   124              "aggregate": 1,
   125              "cursor": {},
   126              "pipeline": [
   127                {
   128                  "$changeStream": {}
   129                }
   130              ]
   131            },
   132            "database_name": "retryable-reads-tests"
   133          }
   134        }
   135      ]
   136    },
   137    {
   138      "description": "db.watch succeeds after NotWritablePrimary",
   139      "failPoint": {
   140        "configureFailPoint": "failCommand",
   141        "mode": {
   142          "times": 1
   143        },
   144        "data": {
   145          "failCommands": [
   146            "aggregate"
   147          ],
   148          "errorCode": 10107
   149        }
   150      },
   151      "operations": [
   152        {
   153          "name": "watch",
   154          "object": "database"
   155        }
   156      ],
   157      "expectations": [
   158        {
   159          "command_started_event": {
   160            "command": {
   161              "aggregate": 1,
   162              "cursor": {},
   163              "pipeline": [
   164                {
   165                  "$changeStream": {}
   166                }
   167              ]
   168            },
   169            "database_name": "retryable-reads-tests"
   170          }
   171        },
   172        {
   173          "command_started_event": {
   174            "command": {
   175              "aggregate": 1,
   176              "cursor": {},
   177              "pipeline": [
   178                {
   179                  "$changeStream": {}
   180                }
   181              ]
   182            },
   183            "database_name": "retryable-reads-tests"
   184          }
   185        }
   186      ]
   187    },
   188    {
   189      "description": "db.watch succeeds after NotPrimaryNoSecondaryOk",
   190      "failPoint": {
   191        "configureFailPoint": "failCommand",
   192        "mode": {
   193          "times": 1
   194        },
   195        "data": {
   196          "failCommands": [
   197            "aggregate"
   198          ],
   199          "errorCode": 13435
   200        }
   201      },
   202      "operations": [
   203        {
   204          "name": "watch",
   205          "object": "database"
   206        }
   207      ],
   208      "expectations": [
   209        {
   210          "command_started_event": {
   211            "command": {
   212              "aggregate": 1,
   213              "cursor": {},
   214              "pipeline": [
   215                {
   216                  "$changeStream": {}
   217                }
   218              ]
   219            },
   220            "database_name": "retryable-reads-tests"
   221          }
   222        },
   223        {
   224          "command_started_event": {
   225            "command": {
   226              "aggregate": 1,
   227              "cursor": {},
   228              "pipeline": [
   229                {
   230                  "$changeStream": {}
   231                }
   232              ]
   233            },
   234            "database_name": "retryable-reads-tests"
   235          }
   236        }
   237      ]
   238    },
   239    {
   240      "description": "db.watch succeeds after NotPrimaryOrSecondary",
   241      "failPoint": {
   242        "configureFailPoint": "failCommand",
   243        "mode": {
   244          "times": 1
   245        },
   246        "data": {
   247          "failCommands": [
   248            "aggregate"
   249          ],
   250          "errorCode": 13436
   251        }
   252      },
   253      "operations": [
   254        {
   255          "name": "watch",
   256          "object": "database"
   257        }
   258      ],
   259      "expectations": [
   260        {
   261          "command_started_event": {
   262            "command": {
   263              "aggregate": 1,
   264              "cursor": {},
   265              "pipeline": [
   266                {
   267                  "$changeStream": {}
   268                }
   269              ]
   270            },
   271            "database_name": "retryable-reads-tests"
   272          }
   273        },
   274        {
   275          "command_started_event": {
   276            "command": {
   277              "aggregate": 1,
   278              "cursor": {},
   279              "pipeline": [
   280                {
   281                  "$changeStream": {}
   282                }
   283              ]
   284            },
   285            "database_name": "retryable-reads-tests"
   286          }
   287        }
   288      ]
   289    },
   290    {
   291      "description": "db.watch succeeds after PrimarySteppedDown",
   292      "failPoint": {
   293        "configureFailPoint": "failCommand",
   294        "mode": {
   295          "times": 1
   296        },
   297        "data": {
   298          "failCommands": [
   299            "aggregate"
   300          ],
   301          "errorCode": 189
   302        }
   303      },
   304      "operations": [
   305        {
   306          "name": "watch",
   307          "object": "database"
   308        }
   309      ],
   310      "expectations": [
   311        {
   312          "command_started_event": {
   313            "command": {
   314              "aggregate": 1,
   315              "cursor": {},
   316              "pipeline": [
   317                {
   318                  "$changeStream": {}
   319                }
   320              ]
   321            },
   322            "database_name": "retryable-reads-tests"
   323          }
   324        },
   325        {
   326          "command_started_event": {
   327            "command": {
   328              "aggregate": 1,
   329              "cursor": {},
   330              "pipeline": [
   331                {
   332                  "$changeStream": {}
   333                }
   334              ]
   335            },
   336            "database_name": "retryable-reads-tests"
   337          }
   338        }
   339      ]
   340    },
   341    {
   342      "description": "db.watch succeeds after ShutdownInProgress",
   343      "failPoint": {
   344        "configureFailPoint": "failCommand",
   345        "mode": {
   346          "times": 1
   347        },
   348        "data": {
   349          "failCommands": [
   350            "aggregate"
   351          ],
   352          "errorCode": 91
   353        }
   354      },
   355      "operations": [
   356        {
   357          "name": "watch",
   358          "object": "database"
   359        }
   360      ],
   361      "expectations": [
   362        {
   363          "command_started_event": {
   364            "command": {
   365              "aggregate": 1,
   366              "cursor": {},
   367              "pipeline": [
   368                {
   369                  "$changeStream": {}
   370                }
   371              ]
   372            },
   373            "database_name": "retryable-reads-tests"
   374          }
   375        },
   376        {
   377          "command_started_event": {
   378            "command": {
   379              "aggregate": 1,
   380              "cursor": {},
   381              "pipeline": [
   382                {
   383                  "$changeStream": {}
   384                }
   385              ]
   386            },
   387            "database_name": "retryable-reads-tests"
   388          }
   389        }
   390      ]
   391    },
   392    {
   393      "description": "db.watch succeeds after HostNotFound",
   394      "failPoint": {
   395        "configureFailPoint": "failCommand",
   396        "mode": {
   397          "times": 1
   398        },
   399        "data": {
   400          "failCommands": [
   401            "aggregate"
   402          ],
   403          "errorCode": 7
   404        }
   405      },
   406      "operations": [
   407        {
   408          "name": "watch",
   409          "object": "database"
   410        }
   411      ],
   412      "expectations": [
   413        {
   414          "command_started_event": {
   415            "command": {
   416              "aggregate": 1,
   417              "cursor": {},
   418              "pipeline": [
   419                {
   420                  "$changeStream": {}
   421                }
   422              ]
   423            },
   424            "database_name": "retryable-reads-tests"
   425          }
   426        },
   427        {
   428          "command_started_event": {
   429            "command": {
   430              "aggregate": 1,
   431              "cursor": {},
   432              "pipeline": [
   433                {
   434                  "$changeStream": {}
   435                }
   436              ]
   437            },
   438            "database_name": "retryable-reads-tests"
   439          }
   440        }
   441      ]
   442    },
   443    {
   444      "description": "db.watch succeeds after HostUnreachable",
   445      "failPoint": {
   446        "configureFailPoint": "failCommand",
   447        "mode": {
   448          "times": 1
   449        },
   450        "data": {
   451          "failCommands": [
   452            "aggregate"
   453          ],
   454          "errorCode": 6
   455        }
   456      },
   457      "operations": [
   458        {
   459          "name": "watch",
   460          "object": "database"
   461        }
   462      ],
   463      "expectations": [
   464        {
   465          "command_started_event": {
   466            "command": {
   467              "aggregate": 1,
   468              "cursor": {},
   469              "pipeline": [
   470                {
   471                  "$changeStream": {}
   472                }
   473              ]
   474            },
   475            "database_name": "retryable-reads-tests"
   476          }
   477        },
   478        {
   479          "command_started_event": {
   480            "command": {
   481              "aggregate": 1,
   482              "cursor": {},
   483              "pipeline": [
   484                {
   485                  "$changeStream": {}
   486                }
   487              ]
   488            },
   489            "database_name": "retryable-reads-tests"
   490          }
   491        }
   492      ]
   493    },
   494    {
   495      "description": "db.watch succeeds after NetworkTimeout",
   496      "failPoint": {
   497        "configureFailPoint": "failCommand",
   498        "mode": {
   499          "times": 1
   500        },
   501        "data": {
   502          "failCommands": [
   503            "aggregate"
   504          ],
   505          "errorCode": 89
   506        }
   507      },
   508      "operations": [
   509        {
   510          "name": "watch",
   511          "object": "database"
   512        }
   513      ],
   514      "expectations": [
   515        {
   516          "command_started_event": {
   517            "command": {
   518              "aggregate": 1,
   519              "cursor": {},
   520              "pipeline": [
   521                {
   522                  "$changeStream": {}
   523                }
   524              ]
   525            },
   526            "database_name": "retryable-reads-tests"
   527          }
   528        },
   529        {
   530          "command_started_event": {
   531            "command": {
   532              "aggregate": 1,
   533              "cursor": {},
   534              "pipeline": [
   535                {
   536                  "$changeStream": {}
   537                }
   538              ]
   539            },
   540            "database_name": "retryable-reads-tests"
   541          }
   542        }
   543      ]
   544    },
   545    {
   546      "description": "db.watch succeeds after SocketException",
   547      "failPoint": {
   548        "configureFailPoint": "failCommand",
   549        "mode": {
   550          "times": 1
   551        },
   552        "data": {
   553          "failCommands": [
   554            "aggregate"
   555          ],
   556          "errorCode": 9001
   557        }
   558      },
   559      "operations": [
   560        {
   561          "name": "watch",
   562          "object": "database"
   563        }
   564      ],
   565      "expectations": [
   566        {
   567          "command_started_event": {
   568            "command": {
   569              "aggregate": 1,
   570              "cursor": {},
   571              "pipeline": [
   572                {
   573                  "$changeStream": {}
   574                }
   575              ]
   576            },
   577            "database_name": "retryable-reads-tests"
   578          }
   579        },
   580        {
   581          "command_started_event": {
   582            "command": {
   583              "aggregate": 1,
   584              "cursor": {},
   585              "pipeline": [
   586                {
   587                  "$changeStream": {}
   588                }
   589              ]
   590            },
   591            "database_name": "retryable-reads-tests"
   592          }
   593        }
   594      ]
   595    },
   596    {
   597      "description": "db.watch fails after two NotWritablePrimary errors",
   598      "failPoint": {
   599        "configureFailPoint": "failCommand",
   600        "mode": {
   601          "times": 2
   602        },
   603        "data": {
   604          "failCommands": [
   605            "aggregate"
   606          ],
   607          "errorCode": 10107
   608        }
   609      },
   610      "operations": [
   611        {
   612          "name": "watch",
   613          "object": "database",
   614          "error": true
   615        }
   616      ],
   617      "expectations": [
   618        {
   619          "command_started_event": {
   620            "command": {
   621              "aggregate": 1,
   622              "cursor": {},
   623              "pipeline": [
   624                {
   625                  "$changeStream": {}
   626                }
   627              ]
   628            },
   629            "database_name": "retryable-reads-tests"
   630          }
   631        },
   632        {
   633          "command_started_event": {
   634            "command": {
   635              "aggregate": 1,
   636              "cursor": {},
   637              "pipeline": [
   638                {
   639                  "$changeStream": {}
   640                }
   641              ]
   642            },
   643            "database_name": "retryable-reads-tests"
   644          }
   645        }
   646      ]
   647    },
   648    {
   649      "description": "db.watch fails after NotWritablePrimary when retryReads is false",
   650      "clientOptions": {
   651        "retryReads": false
   652      },
   653      "failPoint": {
   654        "configureFailPoint": "failCommand",
   655        "mode": {
   656          "times": 1
   657        },
   658        "data": {
   659          "failCommands": [
   660            "aggregate"
   661          ],
   662          "errorCode": 10107
   663        }
   664      },
   665      "operations": [
   666        {
   667          "name": "watch",
   668          "object": "database",
   669          "error": true
   670        }
   671      ],
   672      "expectations": [
   673        {
   674          "command_started_event": {
   675            "command": {
   676              "aggregate": 1,
   677              "cursor": {},
   678              "pipeline": [
   679                {
   680                  "$changeStream": {}
   681                }
   682              ]
   683            },
   684            "database_name": "retryable-reads-tests"
   685          }
   686        }
   687      ]
   688    }
   689  ]
   690}

View as plain text