...

Text file src/go.mongodb.org/mongo-driver/testdata/retryable-writes/legacy/findOneAndReplace-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": "FindOneAndReplace succeeds with RetryableWriteError from server",
    25      "failPoint": {
    26        "configureFailPoint": "failCommand",
    27        "mode": {
    28          "times": 1
    29        },
    30        "data": {
    31          "failCommands": [
    32            "findAndModify"
    33          ],
    34          "errorCode": 112,
    35          "errorLabels": [
    36            "RetryableWriteError"
    37          ]
    38        }
    39      },
    40      "operation": {
    41        "name": "findOneAndReplace",
    42        "arguments": {
    43          "filter": {
    44            "_id": 1
    45          },
    46          "replacement": {
    47            "_id": 1,
    48            "x": 111
    49          },
    50          "returnDocument": "Before"
    51        }
    52      },
    53      "outcome": {
    54        "result": {
    55          "_id": 1,
    56          "x": 11
    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": "FindOneAndReplace fails if server does not return RetryableWriteError",
    74      "failPoint": {
    75        "configureFailPoint": "failCommand",
    76        "mode": {
    77          "times": 1
    78        },
    79        "data": {
    80          "failCommands": [
    81            "findAndModify"
    82          ],
    83          "errorCode": 11600,
    84          "errorLabels": []
    85        }
    86      },
    87      "operation": {
    88        "name": "findOneAndReplace",
    89        "arguments": {
    90          "filter": {
    91            "_id": 1
    92          },
    93          "replacement": {
    94            "_id": 1,
    95            "x": 111
    96          },
    97          "returnDocument": "Before"
    98        }
    99      },
   100      "outcome": {
   101        "error": true,
   102        "result": {
   103          "errorLabelsOmit": [
   104            "RetryableWriteError"
   105          ]
   106        },
   107        "collection": {
   108          "data": [
   109            {
   110              "_id": 1,
   111              "x": 11
   112            },
   113            {
   114              "_id": 2,
   115              "x": 22
   116            }
   117          ]
   118        }
   119      }
   120    }
   121  ]
   122}

View as plain text