...

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

View as plain text