Skip to content

Commit

Permalink
add test
Browse files Browse the repository at this point in the history
  • Loading branch information
baileympearson committed Oct 28, 2024
1 parent 04560fc commit 050054d
Show file tree
Hide file tree
Showing 2 changed files with 237 additions and 0 deletions.

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,88 @@
---
description: pool-cleared-before-checkin

schemaVersion: "1.4"

runOnRequirements:
# failCommand appName requirements
- minServerVersion: "4.4"
serverless: forbid
topologies: [ single, replicaset, sharded ]

createEntities:
- client:
id: &setupClient setupClient
useMultipleMongoses: false

initialData: &initialData
- collectionName: &collectionName find-network-error
databaseName: &databaseName sdam-tests
documents:
- _id: 1
- _id: 2

tests:
- description: Pool is cleared before application connection is checked into the pool
operations:
- name: failPoint
object: testRunner
arguments:
client: *setupClient
failPoint:
configureFailPoint: failCommand
mode:
times: 1
data:
failCommands:
- find
closeConnection: true
appName: findNetworkErrorTest
- name: createEntities
object: testRunner
arguments:
entities:
- client:
id: &client client
useMultipleMongoses: false
observeEvents:
- poolClearedEvent
- connectionCheckedInEvent
uriOptions:
retryWrites: false
retryReads: false
appname: findNetworkErrorTest
- database:
id: &database database
client: *client
databaseName: *databaseName
- collection:
id: &collection collection
database: *database
collectionName: *collectionName
- name: find
object: *collection
arguments:
filter:
_id: 1
expectError:
isError: true
- name: waitForEvent
object: testRunner
arguments:
client: *client
event:
poolClearedEvent: {}
count: 1
- name: waitForEvent
object: testRunner
arguments:
client: *client
event:
connectionCheckedInEvent: {}
count: 1
expectEvents:
- client: *client
eventType: cmap
events:
- poolClearedEvent: {}
- connectionCheckedInEvent: {}

0 comments on commit 050054d

Please sign in to comment.