Skip to content

Commit 47d1822

Browse files
authored
DRIVERS-1555: Test that isClientError considers network errors (#1720)
Also use isClientError in estimatedDocumentCount network error tests
1 parent 77b1f78 commit 47d1822

File tree

6 files changed

+118
-5
lines changed

6 files changed

+118
-5
lines changed

source/crud/tests/unified/estimatedDocumentCount.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

source/crud/tests/unified/estimatedDocumentCount.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ tests:
130130
- name: estimatedDocumentCount
131131
object: *collection0
132132
expectError:
133-
isError: true
133+
isClientError: true
134134
expectEvents:
135135
- client: *client0
136136
events:

source/retryable-reads/tests/unified/estimatedDocumentCount.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

source/retryable-reads/tests/unified/estimatedDocumentCount.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ tests:
116116
object: *collection1
117117
name: estimatedDocumentCount
118118
expectError:
119-
isError: true
119+
isClientError: true
120120
expectEvents:
121121
-
122122
client: *client1

source/unified-test-format/tests/valid-pass/expectedError-isClientError.json

Lines changed: 74 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
description: "expectedError-isClientError"
2+
3+
schemaVersion: "1.3"
4+
5+
runOnRequirements:
6+
- minServerVersion: "4.0"
7+
topologies: [single, replicaset]
8+
- minServerVersion: "4.1.7"
9+
topologies: [sharded, load-balanced]
10+
11+
createEntities:
12+
- client:
13+
id: &client0 client0
14+
useMultipleMongoses: false
15+
- database:
16+
id: &database0 database0
17+
client: *client0
18+
databaseName: &database0Name test
19+
20+
tests:
21+
- description: "isClientError considers network errors"
22+
operations:
23+
- name: failPoint
24+
object: testRunner
25+
arguments:
26+
client: *client0
27+
failPoint:
28+
configureFailPoint: failCommand
29+
mode: { times: 1 }
30+
data:
31+
failCommands: [ ping ]
32+
closeConnection: true
33+
- name: runCommand
34+
object: *database0
35+
arguments:
36+
commandName: ping
37+
command: { ping: 1 }
38+
expectError:
39+
isClientError: true

0 commit comments

Comments
 (0)