Skip to content

Commit

Permalink
DRIVERS-1555: Test that isClientError considers network errors (#1720)
Browse files Browse the repository at this point in the history
Also use isClientError in estimatedDocumentCount network error tests
  • Loading branch information
jmikola authored Nov 4, 2024
1 parent 77b1f78 commit 47d1822
Show file tree
Hide file tree
Showing 6 changed files with 118 additions and 5 deletions.
2 changes: 1 addition & 1 deletion source/crud/tests/unified/estimatedDocumentCount.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion source/crud/tests/unified/estimatedDocumentCount.yml
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ tests:
- name: estimatedDocumentCount
object: *collection0
expectError:
isError: true
isClientError: true
expectEvents:
- client: *client0
events:
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ tests:
object: *collection1
name: estimatedDocumentCount
expectError:
isError: true
isClientError: true
expectEvents:
-
client: *client1
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
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 client0
useMultipleMongoses: false
- database:
id: &database0 database0
client: *client0
databaseName: &database0Name 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

0 comments on commit 47d1822

Please sign in to comment.