Skip to content

Commit 0c6f846

Browse files
authored
PYTHON-4942 & PYTHON-4936 Test that isClientError considers network errors and operations may be an empty array (#2236)
1 parent 33843d2 commit 0c6f846

File tree

3 files changed

+86
-2
lines changed

3 files changed

+86
-2
lines changed

test/retryable_reads/unified/estimatedDocumentCount.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@
195195
"object": "collection1",
196196
"name": "estimatedDocumentCount",
197197
"expectError": {
198-
"isError": true
198+
"isClientError": true
199199
}
200200
}
201201
],
@@ -241,7 +241,7 @@
241241
"object": "collection0",
242242
"name": "estimatedDocumentCount",
243243
"expectError": {
244-
"isError": true
244+
"isClientError": true
245245
}
246246
}
247247
],
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
{
2+
"description": "expectedError-isClientError",
3+
"schemaVersion": "1.3",
4+
"runOnRequirements": [
5+
{
6+
"minServerVersion": "4.0",
7+
"topologies": [
8+
"single",
9+
"replicaset"
10+
]
11+
},
12+
{
13+
"minServerVersion": "4.1.7",
14+
"topologies": [
15+
"sharded",
16+
"load-balanced"
17+
]
18+
}
19+
],
20+
"createEntities": [
21+
{
22+
"client": {
23+
"id": "client0",
24+
"useMultipleMongoses": false
25+
}
26+
},
27+
{
28+
"database": {
29+
"id": "database0",
30+
"client": "client0",
31+
"databaseName": "test"
32+
}
33+
}
34+
],
35+
"tests": [
36+
{
37+
"description": "isClientError considers network errors",
38+
"operations": [
39+
{
40+
"name": "failPoint",
41+
"object": "testRunner",
42+
"arguments": {
43+
"client": "client0",
44+
"failPoint": {
45+
"configureFailPoint": "failCommand",
46+
"mode": {
47+
"times": 1
48+
},
49+
"data": {
50+
"failCommands": [
51+
"ping"
52+
],
53+
"closeConnection": true
54+
}
55+
}
56+
}
57+
},
58+
{
59+
"name": "runCommand",
60+
"object": "database0",
61+
"arguments": {
62+
"commandName": "ping",
63+
"command": {
64+
"ping": 1
65+
}
66+
},
67+
"expectError": {
68+
"isClientError": true
69+
}
70+
}
71+
]
72+
}
73+
]
74+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"description": "operation-empty_array",
3+
"schemaVersion": "1.0",
4+
"tests": [
5+
{
6+
"description": "Empty operations array",
7+
"operations": []
8+
}
9+
]
10+
}

0 commit comments

Comments
 (0)