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