PYTHON-4942 & PYTHON-4936 Test that isClientError considers network errors and operations may be an empty array (#2236)

This commit is contained in:
Steven Silvester 2025-03-27 13:09:09 -05:00 committed by GitHub
parent 33843d285b
commit 0c6f84642c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 86 additions and 2 deletions

View File

@ -195,7 +195,7 @@
"object": "collection1",
"name": "estimatedDocumentCount",
"expectError": {
"isError": true
"isClientError": true
}
}
],
@ -241,7 +241,7 @@
"object": "collection0",
"name": "estimatedDocumentCount",
"expectError": {
"isError": true
"isClientError": true
}
}
],

View File

@ -0,0 +1,74 @@
{
"description": "expectedError-isClientError",
"schemaVersion": "1.3",
"runOnRequirements": [
{
"minServerVersion": "4.0",
"topologies": [
"single",
"replicaset"
]
},
{
"minServerVersion": "4.1.7",
"topologies": [
"sharded",
"load-balanced"
]
}
],
"createEntities": [
{
"client": {
"id": "client0",
"useMultipleMongoses": false
}
},
{
"database": {
"id": "database0",
"client": "client0",
"databaseName": "test"
}
}
],
"tests": [
{
"description": "isClientError considers network errors",
"operations": [
{
"name": "failPoint",
"object": "testRunner",
"arguments": {
"client": "client0",
"failPoint": {
"configureFailPoint": "failCommand",
"mode": {
"times": 1
},
"data": {
"failCommands": [
"ping"
],
"closeConnection": true
}
}
}
},
{
"name": "runCommand",
"object": "database0",
"arguments": {
"commandName": "ping",
"command": {
"ping": 1
}
},
"expectError": {
"isClientError": true
}
}
]
}
]
}

View File

@ -0,0 +1,10 @@
{
"description": "operation-empty_array",
"schemaVersion": "1.0",
"tests": [
{
"description": "Empty operations array",
"operations": []
}
]
}