...

Text file src/go.mongodb.org/mongo-driver/testdata/retryable-writes/legacy/updateOne-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": "UpdateOne 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": "updateOne",
    42        "arguments": {
    43          "filter": {
    44            "_id": 1
    45          },
    46          "update": {
    47            "$inc": {
    48              "x": 1
    49            }
    50          }
    51        }
    52      },
    53      "outcome": {
    54        "result": {
    55          "matchedCount": 1,
    56          "modifiedCount": 1,
    57          "upsertedCount": 0
    58        },
    59        "collection": {
    60          "data": [
    61            {
    62              "_id": 1,
    63              "x": 12
    64            },
    65            {
    66              "_id": 2,
    67              "x": 22
    68            }
    69          ]
    70        }
    71      }
    72    },
    73    {
    74      "description": "UpdateOne fails if server does not return RetryableWriteError",
    75      "failPoint": {
    76        "configureFailPoint": "failCommand",
    77        "mode": {
    78          "times": 1
    79        },
    80        "data": {
    81          "failCommands": [
    82            "update"
    83          ],
    84          "errorCode": 11600,
    85          "errorLabels": []
    86        }
    87      },
    88      "operation": {
    89        "name": "updateOne",
    90        "arguments": {
    91          "filter": {
    92            "_id": 1
    93          },
    94          "update": {
    95            "$inc": {
    96              "x": 1
    97            }
    98          }
    99        }
   100      },
   101      "outcome": {
   102        "error": true,
   103        "result": {
   104          "errorLabelsOmit": [
   105            "RetryableWriteError"
   106          ]
   107        },
   108        "collection": {
   109          "data": [
   110            {
   111              "_id": 1,
   112              "x": 11
   113            },
   114            {
   115              "_id": 2,
   116              "x": 22
   117            }
   118          ]
   119        }
   120      }
   121    }
   122  ]
   123}

View as plain text