...

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

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

     1{
     2  "runOn": [
     3    {
     4      "minServerVersion": "3.6",
     5      "topology": [
     6        "replicaset"
     7      ]
     8    }
     9  ],
    10  "data": [
    11    {
    12      "_id": 1,
    13      "x": 11
    14    },
    15    {
    16      "_id": 2,
    17      "x": 22
    18    }
    19  ],
    20  "tests": [
    21    {
    22      "description": "InsertOne is committed on first attempt",
    23      "failPoint": {
    24        "configureFailPoint": "onPrimaryTransactionalWrite",
    25        "mode": {
    26          "times": 1
    27        }
    28      },
    29      "operation": {
    30        "name": "insertOne",
    31        "arguments": {
    32          "document": {
    33            "_id": 3,
    34            "x": 33
    35          }
    36        }
    37      },
    38      "outcome": {
    39        "result": {
    40          "insertedId": 3
    41        },
    42        "collection": {
    43          "data": [
    44            {
    45              "_id": 1,
    46              "x": 11
    47            },
    48            {
    49              "_id": 2,
    50              "x": 22
    51            },
    52            {
    53              "_id": 3,
    54              "x": 33
    55            }
    56          ]
    57        }
    58      }
    59    },
    60    {
    61      "description": "InsertOne is not committed on first attempt",
    62      "failPoint": {
    63        "configureFailPoint": "onPrimaryTransactionalWrite",
    64        "mode": {
    65          "times": 1
    66        },
    67        "data": {
    68          "failBeforeCommitExceptionCode": 1
    69        }
    70      },
    71      "operation": {
    72        "name": "insertOne",
    73        "arguments": {
    74          "document": {
    75            "_id": 3,
    76            "x": 33
    77          }
    78        }
    79      },
    80      "outcome": {
    81        "result": {
    82          "insertedId": 3
    83        },
    84        "collection": {
    85          "data": [
    86            {
    87              "_id": 1,
    88              "x": 11
    89            },
    90            {
    91              "_id": 2,
    92              "x": 22
    93            },
    94            {
    95              "_id": 3,
    96              "x": 33
    97            }
    98          ]
    99        }
   100      }
   101    },
   102    {
   103      "description": "InsertOne is never committed",
   104      "failPoint": {
   105        "configureFailPoint": "onPrimaryTransactionalWrite",
   106        "mode": {
   107          "times": 2
   108        },
   109        "data": {
   110          "failBeforeCommitExceptionCode": 1
   111        }
   112      },
   113      "operation": {
   114        "name": "insertOne",
   115        "arguments": {
   116          "document": {
   117            "_id": 3,
   118            "x": 33
   119          }
   120        }
   121      },
   122      "outcome": {
   123        "error": true,
   124        "collection": {
   125          "data": [
   126            {
   127              "_id": 1,
   128              "x": 11
   129            },
   130            {
   131              "_id": 2,
   132              "x": 22
   133            }
   134          ]
   135        }
   136      }
   137    }
   138  ]
   139}

View as plain text