...

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

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

     1runOn:
     2    -
     3        minServerVersion: "3.6"
     4        topology: ["replicaset"]
     5
     6data:
     7    - { _id: 1, x: 11 }
     8    - { _id: 2, x: 22 }
     9
    10tests:
    11    -
    12        description: "InsertOne is committed on first attempt"
    13        failPoint:
    14            configureFailPoint: onPrimaryTransactionalWrite
    15            mode: { times: 1 }
    16        operation:
    17            name: "insertOne"
    18            arguments:
    19                document: { _id: 3, x: 33 }
    20        outcome:
    21            result:
    22                insertedId: 3
    23            collection:
    24                data:
    25                    - { _id: 1, x: 11 }
    26                    - { _id: 2, x: 22 }
    27                    - { _id: 3, x: 33 }
    28    -
    29        description: "InsertOne is not committed on first attempt"
    30        failPoint:
    31            configureFailPoint: onPrimaryTransactionalWrite
    32            mode: { times: 1 }
    33            data: { failBeforeCommitExceptionCode: 1 }
    34        operation:
    35            name: "insertOne"
    36            arguments:
    37                document: { _id: 3, x: 33 }
    38        outcome:
    39            result:
    40                insertedId: 3
    41            collection:
    42                data:
    43                    - { _id: 1, x: 11 }
    44                    - { _id: 2, x: 22 }
    45                    - { _id: 3, x: 33 }
    46    -
    47        description: "InsertOne is never committed"
    48        failPoint:
    49            configureFailPoint: onPrimaryTransactionalWrite
    50            mode: { times: 2 }
    51            data: { failBeforeCommitExceptionCode: 1 }
    52        operation:
    53            name: "insertOne"
    54            arguments:
    55                document: { _id: 3, x: 33 }
    56        outcome:
    57            error: true
    58            collection:
    59                data:
    60                    - { _id: 1, x: 11 }
    61                    - { _id: 2, x: 22 }

View as plain text