{
  "runOn": [
    {
      "minServerVersion": "4.3.1",
      "topology": [
        "replicaset",
        "sharded",
        "load-balanced"
      ]
    }
  ],
  "data": [
    {
      "_id": 1,
      "x": 11
    },
    {
      "_id": 2,
      "x": 22
    }
  ],
  "tests": [
    {
      "description": "DeleteOne succeeds with RetryableWriteError from server",
      "failPoint": {
        "configureFailPoint": "failCommand",
        "mode": {
          "times": 1
        },
        "data": {
          "failCommands": [
            "delete"
          ],
          "errorCode": 112,
          "errorLabels": [
            "RetryableWriteError"
          ]
        }
      },
      "operation": {
        "name": "deleteOne",
        "arguments": {
          "filter": {
            "_id": 1
          }
        }
      },
      "outcome": {
        "result": {
          "deletedCount": 1
        },
        "collection": {
          "data": [
            {
              "_id": 2,
              "x": 22
            }
          ]
        }
      }
    },
    {
      "description": "DeleteOne fails if server does not return RetryableWriteError",
      "failPoint": {
        "configureFailPoint": "failCommand",
        "mode": {
          "times": 1
        },
        "data": {
          "failCommands": [
            "delete"
          ],
          "errorCode": 11600,
          "errorLabels": []
        }
      },
      "operation": {
        "name": "deleteOne",
        "arguments": {
          "filter": {
            "_id": 1
          }
        }
      },
      "outcome": {
        "error": true,
        "result": {
          "errorLabelsOmit": [
            "RetryableWriteError"
          ]
        },
        "collection": {
          "data": [
            {
              "_id": 1,
              "x": 11
            },
            {
              "_id": 2,
              "x": 22
            }
          ]
        }
      }
    },
    {
      "description": "DeleteOne succeeds after PrimarySteppedDown",
      "failPoint": {
        "configureFailPoint": "failCommand",
        "mode": {
          "times": 1
        },
        "data": {
          "failCommands": [
            "delete"
          ],
          "errorCode": 189,
          "errorLabels": [
            "RetryableWriteError"
          ]
        }
      },
      "operation": {
        "name": "deleteOne",
        "arguments": {
          "filter": {
            "_id": 1
          }
        }
      },
      "outcome": {
        "result": {
          "deletedCount": 1
        },
        "collection": {
          "data": [
            {
              "_id": 2,
              "x": 22
            }
          ]
        }
      }
    },
    {
      "description": "DeleteOne succeeds after WriteConcernError ShutdownInProgress",
      "failPoint": {
        "configureFailPoint": "failCommand",
        "mode": {
          "times": 1
        },
        "data": {
          "failCommands": [
            "delete"
          ],
          "errorLabels": [
            "RetryableWriteError"
          ],
          "writeConcernError": {
            "code": 91,
            "errmsg": "Replication is being shut down"
          }
        }
      },
      "operation": {
        "name": "deleteOne",
        "arguments": {
          "filter": {
            "_id": 1
          }
        }
      },
      "outcome": {
        "result": {
          "deletedCount": 1
        },
        "collection": {
          "data": [
            {
              "_id": 2,
              "x": 22
            }
          ]
        }
      }
    }
  ]
}
