| {
  "runOn": [
    {
      "minServerVersion": "4.0",
      "topology": [
        "single",
        "replicaset"
      ]
    },
    {
      "minServerVersion": "4.1.7",
      "topology": [
        "sharded"
      ]
    }
  ],
  "database_name": "retryable-reads-tests",
  "collection_name": "coll",
  "data": [],
  "tests": [
    {
      "description": "ListIndexes succeeds on first attempt",
      "operations": [
        {
          "name": "listIndexes",
          "object": "collection"
        }
      ],
      "expectations": [
        {
          "command_started_event": {
            "command": {
              "listIndexes": "coll"
            },
            "database_name": "retryable-reads-tests"
          }
        }
      ]
    },
    {
      "description": "ListIndexes succeeds on second attempt",
      "failPoint": {
        "configureFailPoint": "failCommand",
        "mode": {
          "times": 1
        },
        "data": {
          "failCommands": [
            "listIndexes"
          ],
          "closeConnection": true
        }
      },
      "operations": [
        {
          "name": "listIndexes",
          "object": "collection"
        }
      ],
      "expectations": [
        {
          "command_started_event": {
            "command": {
              "listIndexes": "coll"
            },
            "database_name": "retryable-reads-tests"
          }
        },
        {
          "command_started_event": {
            "command": {
              "listIndexes": "coll"
            },
            "database_name": "retryable-reads-tests"
          }
        }
      ]
    },
    {
      "description": "ListIndexes fails on first attempt",
      "clientOptions": {
        "retryReads": false
      },
      "failPoint": {
        "configureFailPoint": "failCommand",
        "mode": {
          "times": 1
        },
        "data": {
          "failCommands": [
            "listIndexes"
          ],
          "closeConnection": true
        }
      },
      "operations": [
        {
          "name": "listIndexes",
          "object": "collection",
          "error": true
        }
      ],
      "expectations": [
        {
          "command_started_event": {
            "command": {
              "listIndexes": "coll"
            },
            "database_name": "retryable-reads-tests"
          }
        }
      ]
    },
    {
      "description": "ListIndexes fails on second attempt",
      "failPoint": {
        "configureFailPoint": "failCommand",
        "mode": {
          "times": 2
        },
        "data": {
          "failCommands": [
            "listIndexes"
          ],
          "closeConnection": true
        }
      },
      "operations": [
        {
          "name": "listIndexes",
          "object": "collection",
          "error": true
        }
      ],
      "expectations": [
        {
          "command_started_event": {
            "command": {
              "listIndexes": "coll"
            },
            "database_name": "retryable-reads-tests"
          }
        },
        {
          "command_started_event": {
            "command": {
              "listIndexes": "coll"
            },
            "database_name": "retryable-reads-tests"
          }
        }
      ]
    }
  ]
}
 |