mongo-python-driver/test/retryable_reads/unified/listCollectionNames-serverErrors.json

711 lines
16 KiB
JSON

{
"description": "listCollectionNames-serverErrors",
"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"
]
}
},
{
"database": {
"id": "database0",
"client": "client0",
"databaseName": "retryable-reads-tests"
}
}
],
"initialData": [
{
"collectionName": "coll",
"databaseName": "retryable-reads-tests",
"documents": []
}
],
"tests": [
{
"description": "ListCollectionNames succeeds after InterruptedAtShutdown",
"operations": [
{
"object": "testRunner",
"name": "failPoint",
"arguments": {
"client": "client0",
"failPoint": {
"configureFailPoint": "failCommand",
"mode": {
"times": 1
},
"data": {
"failCommands": [
"listCollections"
],
"errorCode": 11600
}
}
}
},
{
"object": "database0",
"name": "listCollectionNames"
}
],
"expectEvents": [
{
"client": "client0",
"events": [
{
"commandStartedEvent": {
"command": {
"listCollections": 1
}
}
},
{
"commandStartedEvent": {
"command": {
"listCollections": 1
}
}
}
]
}
]
},
{
"description": "ListCollectionNames succeeds after InterruptedDueToReplStateChange",
"operations": [
{
"object": "testRunner",
"name": "failPoint",
"arguments": {
"client": "client0",
"failPoint": {
"configureFailPoint": "failCommand",
"mode": {
"times": 1
},
"data": {
"failCommands": [
"listCollections"
],
"errorCode": 11602
}
}
}
},
{
"object": "database0",
"name": "listCollectionNames"
}
],
"expectEvents": [
{
"client": "client0",
"events": [
{
"commandStartedEvent": {
"command": {
"listCollections": 1
}
}
},
{
"commandStartedEvent": {
"command": {
"listCollections": 1
}
}
}
]
}
]
},
{
"description": "ListCollectionNames succeeds after NotWritablePrimary",
"operations": [
{
"object": "testRunner",
"name": "failPoint",
"arguments": {
"client": "client0",
"failPoint": {
"configureFailPoint": "failCommand",
"mode": {
"times": 1
},
"data": {
"failCommands": [
"listCollections"
],
"errorCode": 10107
}
}
}
},
{
"object": "database0",
"name": "listCollectionNames"
}
],
"expectEvents": [
{
"client": "client0",
"events": [
{
"commandStartedEvent": {
"command": {
"listCollections": 1
}
}
},
{
"commandStartedEvent": {
"command": {
"listCollections": 1
}
}
}
]
}
]
},
{
"description": "ListCollectionNames succeeds after NotPrimaryNoSecondaryOk",
"operations": [
{
"object": "testRunner",
"name": "failPoint",
"arguments": {
"client": "client0",
"failPoint": {
"configureFailPoint": "failCommand",
"mode": {
"times": 1
},
"data": {
"failCommands": [
"listCollections"
],
"errorCode": 13435
}
}
}
},
{
"object": "database0",
"name": "listCollectionNames"
}
],
"expectEvents": [
{
"client": "client0",
"events": [
{
"commandStartedEvent": {
"command": {
"listCollections": 1
}
}
},
{
"commandStartedEvent": {
"command": {
"listCollections": 1
}
}
}
]
}
]
},
{
"description": "ListCollectionNames succeeds after NotPrimaryOrSecondary",
"operations": [
{
"object": "testRunner",
"name": "failPoint",
"arguments": {
"client": "client0",
"failPoint": {
"configureFailPoint": "failCommand",
"mode": {
"times": 1
},
"data": {
"failCommands": [
"listCollections"
],
"errorCode": 13436
}
}
}
},
{
"object": "database0",
"name": "listCollectionNames"
}
],
"expectEvents": [
{
"client": "client0",
"events": [
{
"commandStartedEvent": {
"command": {
"listCollections": 1
}
}
},
{
"commandStartedEvent": {
"command": {
"listCollections": 1
}
}
}
]
}
]
},
{
"description": "ListCollectionNames succeeds after PrimarySteppedDown",
"operations": [
{
"object": "testRunner",
"name": "failPoint",
"arguments": {
"client": "client0",
"failPoint": {
"configureFailPoint": "failCommand",
"mode": {
"times": 1
},
"data": {
"failCommands": [
"listCollections"
],
"errorCode": 189
}
}
}
},
{
"object": "database0",
"name": "listCollectionNames"
}
],
"expectEvents": [
{
"client": "client0",
"events": [
{
"commandStartedEvent": {
"command": {
"listCollections": 1
}
}
},
{
"commandStartedEvent": {
"command": {
"listCollections": 1
}
}
}
]
}
]
},
{
"description": "ListCollectionNames succeeds after ShutdownInProgress",
"operations": [
{
"object": "testRunner",
"name": "failPoint",
"arguments": {
"client": "client0",
"failPoint": {
"configureFailPoint": "failCommand",
"mode": {
"times": 1
},
"data": {
"failCommands": [
"listCollections"
],
"errorCode": 91
}
}
}
},
{
"object": "database0",
"name": "listCollectionNames"
}
],
"expectEvents": [
{
"client": "client0",
"events": [
{
"commandStartedEvent": {
"command": {
"listCollections": 1
}
}
},
{
"commandStartedEvent": {
"command": {
"listCollections": 1
}
}
}
]
}
]
},
{
"description": "ListCollectionNames succeeds after HostNotFound",
"operations": [
{
"object": "testRunner",
"name": "failPoint",
"arguments": {
"client": "client0",
"failPoint": {
"configureFailPoint": "failCommand",
"mode": {
"times": 1
},
"data": {
"failCommands": [
"listCollections"
],
"errorCode": 7
}
}
}
},
{
"object": "database0",
"name": "listCollectionNames"
}
],
"expectEvents": [
{
"client": "client0",
"events": [
{
"commandStartedEvent": {
"command": {
"listCollections": 1
}
}
},
{
"commandStartedEvent": {
"command": {
"listCollections": 1
}
}
}
]
}
]
},
{
"description": "ListCollectionNames succeeds after HostUnreachable",
"operations": [
{
"object": "testRunner",
"name": "failPoint",
"arguments": {
"client": "client0",
"failPoint": {
"configureFailPoint": "failCommand",
"mode": {
"times": 1
},
"data": {
"failCommands": [
"listCollections"
],
"errorCode": 6
}
}
}
},
{
"object": "database0",
"name": "listCollectionNames"
}
],
"expectEvents": [
{
"client": "client0",
"events": [
{
"commandStartedEvent": {
"command": {
"listCollections": 1
}
}
},
{
"commandStartedEvent": {
"command": {
"listCollections": 1
}
}
}
]
}
]
},
{
"description": "ListCollectionNames succeeds after NetworkTimeout",
"operations": [
{
"object": "testRunner",
"name": "failPoint",
"arguments": {
"client": "client0",
"failPoint": {
"configureFailPoint": "failCommand",
"mode": {
"times": 1
},
"data": {
"failCommands": [
"listCollections"
],
"errorCode": 89
}
}
}
},
{
"object": "database0",
"name": "listCollectionNames"
}
],
"expectEvents": [
{
"client": "client0",
"events": [
{
"commandStartedEvent": {
"command": {
"listCollections": 1
}
}
},
{
"commandStartedEvent": {
"command": {
"listCollections": 1
}
}
}
]
}
]
},
{
"description": "ListCollectionNames succeeds after SocketException",
"operations": [
{
"object": "testRunner",
"name": "failPoint",
"arguments": {
"client": "client0",
"failPoint": {
"configureFailPoint": "failCommand",
"mode": {
"times": 1
},
"data": {
"failCommands": [
"listCollections"
],
"errorCode": 9001
}
}
}
},
{
"object": "database0",
"name": "listCollectionNames"
}
],
"expectEvents": [
{
"client": "client0",
"events": [
{
"commandStartedEvent": {
"command": {
"listCollections": 1
}
}
},
{
"commandStartedEvent": {
"command": {
"listCollections": 1
}
}
}
]
}
]
},
{
"description": "ListCollectionNames fails after two NotWritablePrimary errors",
"operations": [
{
"object": "testRunner",
"name": "failPoint",
"arguments": {
"client": "client0",
"failPoint": {
"configureFailPoint": "failCommand",
"mode": {
"times": 2
},
"data": {
"failCommands": [
"listCollections"
],
"errorCode": 10107
}
}
}
},
{
"object": "database0",
"name": "listCollectionNames",
"expectError": {
"isError": true
}
}
],
"expectEvents": [
{
"client": "client0",
"events": [
{
"commandStartedEvent": {
"command": {
"listCollections": 1
}
}
},
{
"commandStartedEvent": {
"command": {
"listCollections": 1
}
}
}
]
}
]
},
{
"description": "ListCollectionNames fails after NotWritablePrimary when retryReads is false",
"operations": [
{
"object": "testRunner",
"name": "createEntities",
"arguments": {
"entities": [
{
"client": {
"id": "client1",
"useMultipleMongoses": false,
"uriOptions": {
"retryReads": false
},
"observeEvents": [
"commandStartedEvent"
]
}
},
{
"database": {
"id": "database1",
"client": "client1",
"databaseName": "retryable-reads-tests"
}
}
]
}
},
{
"object": "testRunner",
"name": "failPoint",
"arguments": {
"client": "client1",
"failPoint": {
"configureFailPoint": "failCommand",
"mode": {
"times": 1
},
"data": {
"failCommands": [
"listCollections"
],
"errorCode": 10107
}
}
}
},
{
"object": "database1",
"name": "listCollectionNames",
"expectError": {
"isError": true
}
}
],
"expectEvents": [
{
"client": "client1",
"events": [
{
"commandStartedEvent": {
"command": {
"listCollections": 1
}
}
}
]
}
]
}
]
}