mongo-python-driver/test/retryable_reads/unified/listDatabaseNames.json

230 lines
4.9 KiB
JSON

{
"description": "listDatabaseNames",
"schemaVersion": "1.9",
"runOnRequirements": [
{
"minServerVersion": "4.0",
"topologies": [
"single",
"replicaset"
]
},
{
"minServerVersion": "4.1.7",
"topologies": [
"sharded",
"load-balanced"
]
}
],
"createEntities": [
{
"client": {
"id": "client0",
"useMultipleMongoses": false,
"observeEvents": [
"commandStartedEvent"
]
}
}
],
"initialData": [
{
"collectionName": "coll",
"databaseName": "retryable-reads-tests",
"documents": []
}
],
"tests": [
{
"description": "ListDatabaseNames succeeds on first attempt",
"operations": [
{
"object": "client0",
"name": "listDatabaseNames"
}
],
"expectEvents": [
{
"client": "client0",
"events": [
{
"commandStartedEvent": {
"command": {
"listDatabases": 1
}
}
}
]
}
]
},
{
"description": "ListDatabaseNames succeeds on second attempt",
"operations": [
{
"object": "testRunner",
"name": "failPoint",
"arguments": {
"client": "client0",
"failPoint": {
"configureFailPoint": "failCommand",
"mode": {
"times": 1
},
"data": {
"failCommands": [
"listDatabases"
],
"closeConnection": true
}
}
}
},
{
"object": "client0",
"name": "listDatabaseNames"
}
],
"expectEvents": [
{
"client": "client0",
"events": [
{
"commandStartedEvent": {
"command": {
"listDatabases": 1
}
}
},
{
"commandStartedEvent": {
"command": {
"listDatabases": 1
}
}
}
]
}
]
},
{
"description": "ListDatabaseNames fails on first attempt",
"operations": [
{
"object": "testRunner",
"name": "createEntities",
"arguments": {
"entities": [
{
"client": {
"id": "client1",
"useMultipleMongoses": false,
"uriOptions": {
"retryReads": false
},
"observeEvents": [
"commandStartedEvent"
]
}
}
]
}
},
{
"object": "testRunner",
"name": "failPoint",
"arguments": {
"client": "client1",
"failPoint": {
"configureFailPoint": "failCommand",
"mode": {
"times": 1
},
"data": {
"failCommands": [
"listDatabases"
],
"closeConnection": true
}
}
}
},
{
"object": "client1",
"name": "listDatabaseNames",
"expectError": {
"isError": true
}
}
],
"expectEvents": [
{
"client": "client1",
"events": [
{
"commandStartedEvent": {
"command": {
"listDatabases": 1
}
}
}
]
}
]
},
{
"description": "ListDatabaseNames fails on second attempt",
"operations": [
{
"object": "testRunner",
"name": "failPoint",
"arguments": {
"client": "client0",
"failPoint": {
"configureFailPoint": "failCommand",
"mode": {
"times": 2
},
"data": {
"failCommands": [
"listDatabases"
],
"closeConnection": true
}
}
}
},
{
"object": "client0",
"name": "listDatabaseNames",
"expectError": {
"isError": true
}
}
],
"expectEvents": [
{
"client": "client0",
"events": [
{
"commandStartedEvent": {
"command": {
"listDatabases": 1
}
}
},
{
"commandStartedEvent": {
"command": {
"listDatabases": 1
}
}
}
]
}
]
}
]
}