...

Text file src/go.mongodb.org/mongo-driver/testdata/retryable-writes/legacy/bulkWrite-errorLabels.json

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

     1{
     2  "runOn": [
     3    {
     4      "minServerVersion": "4.3.1",
     5      "topology": [
     6        "replicaset",
     7        "sharded",
     8        "load-balanced"
     9      ]
    10    }
    11  ],
    12  "data": [
    13    {
    14      "_id": 1,
    15      "x": 11
    16    },
    17    {
    18      "_id": 2,
    19      "x": 22
    20    }
    21  ],
    22  "tests": [
    23    {
    24      "description": "BulkWrite succeeds with RetryableWriteError from server",
    25      "failPoint": {
    26        "configureFailPoint": "failCommand",
    27        "mode": {
    28          "times": 1
    29        },
    30        "data": {
    31          "failCommands": [
    32            "update"
    33          ],
    34          "errorCode": 112,
    35          "errorLabels": [
    36            "RetryableWriteError"
    37          ]
    38        }
    39      },
    40      "operation": {
    41        "name": "bulkWrite",
    42        "arguments": {
    43          "requests": [
    44            {
    45              "name": "deleteOne",
    46              "arguments": {
    47                "filter": {
    48                  "_id": 1
    49                }
    50              }
    51            },
    52            {
    53              "name": "insertOne",
    54              "arguments": {
    55                "document": {
    56                  "_id": 3,
    57                  "x": 33
    58                }
    59              }
    60            },
    61            {
    62              "name": "updateOne",
    63              "arguments": {
    64                "filter": {
    65                  "_id": 2
    66                },
    67                "update": {
    68                  "$inc": {
    69                    "x": 1
    70                  }
    71                }
    72              }
    73            }
    74          ],
    75          "options": {
    76            "ordered": true
    77          }
    78        }
    79      },
    80      "outcome": {
    81        "result": {
    82          "deletedCount": 1,
    83          "insertedCount": 1,
    84          "insertedIds": {
    85            "1": 3
    86          },
    87          "matchedCount": 1,
    88          "modifiedCount": 1,
    89          "upsertedCount": 0,
    90          "upsertedIds": {}
    91        },
    92        "collection": {
    93          "data": [
    94            {
    95              "_id": 2,
    96              "x": 23
    97            },
    98            {
    99              "_id": 3,
   100              "x": 33
   101            }
   102          ]
   103        }
   104      }
   105    },
   106    {
   107      "description": "BulkWrite fails if server does not return RetryableWriteError",
   108      "failPoint": {
   109        "configureFailPoint": "failCommand",
   110        "mode": {
   111          "times": 1
   112        },
   113        "data": {
   114          "failCommands": [
   115            "update"
   116          ],
   117          "errorCode": 11600,
   118          "errorLabels": []
   119        }
   120      },
   121      "operation": {
   122        "name": "bulkWrite",
   123        "arguments": {
   124          "requests": [
   125            {
   126              "name": "deleteOne",
   127              "arguments": {
   128                "filter": {
   129                  "_id": 1
   130                }
   131              }
   132            },
   133            {
   134              "name": "insertOne",
   135              "arguments": {
   136                "document": {
   137                  "_id": 3,
   138                  "x": 33
   139                }
   140              }
   141            },
   142            {
   143              "name": "updateOne",
   144              "arguments": {
   145                "filter": {
   146                  "_id": 2
   147                },
   148                "update": {
   149                  "$inc": {
   150                    "x": 1
   151                  }
   152                }
   153              }
   154            }
   155          ],
   156          "options": {
   157            "ordered": true
   158          }
   159        }
   160      },
   161      "outcome": {
   162        "error": true,
   163        "result": {
   164          "errorLabelsOmit": [
   165            "RetryableWriteError"
   166          ]
   167        },
   168        "collection": {
   169          "data": [
   170            {
   171              "_id": 2,
   172              "x": 22
   173            },
   174            {
   175              "_id": 3,
   176              "x": 33
   177            }
   178          ]
   179        }
   180      }
   181    }
   182  ]
   183}

View as plain text