Skip to content

Commit 050054d

Browse files
add test
1 parent 04560fc commit 050054d

File tree

2 files changed

+237
-0
lines changed

2 files changed

+237
-0
lines changed

source/server-discovery-and-monitoring/tests/unified/pool-clear-before-checkin.json

Lines changed: 149 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
---
2+
description: pool-cleared-before-checkin
3+
4+
schemaVersion: "1.4"
5+
6+
runOnRequirements:
7+
# failCommand appName requirements
8+
- minServerVersion: "4.4"
9+
serverless: forbid
10+
topologies: [ single, replicaset, sharded ]
11+
12+
createEntities:
13+
- client:
14+
id: &setupClient setupClient
15+
useMultipleMongoses: false
16+
17+
initialData: &initialData
18+
- collectionName: &collectionName find-network-error
19+
databaseName: &databaseName sdam-tests
20+
documents:
21+
- _id: 1
22+
- _id: 2
23+
24+
tests:
25+
- description: Pool is cleared before application connection is checked into the pool
26+
operations:
27+
- name: failPoint
28+
object: testRunner
29+
arguments:
30+
client: *setupClient
31+
failPoint:
32+
configureFailPoint: failCommand
33+
mode:
34+
times: 1
35+
data:
36+
failCommands:
37+
- find
38+
closeConnection: true
39+
appName: findNetworkErrorTest
40+
- name: createEntities
41+
object: testRunner
42+
arguments:
43+
entities:
44+
- client:
45+
id: &client client
46+
useMultipleMongoses: false
47+
observeEvents:
48+
- poolClearedEvent
49+
- connectionCheckedInEvent
50+
uriOptions:
51+
retryWrites: false
52+
retryReads: false
53+
appname: findNetworkErrorTest
54+
- database:
55+
id: &database database
56+
client: *client
57+
databaseName: *databaseName
58+
- collection:
59+
id: &collection collection
60+
database: *database
61+
collectionName: *collectionName
62+
- name: find
63+
object: *collection
64+
arguments:
65+
filter:
66+
_id: 1
67+
expectError:
68+
isError: true
69+
- name: waitForEvent
70+
object: testRunner
71+
arguments:
72+
client: *client
73+
event:
74+
poolClearedEvent: {}
75+
count: 1
76+
- name: waitForEvent
77+
object: testRunner
78+
arguments:
79+
client: *client
80+
event:
81+
connectionCheckedInEvent: {}
82+
count: 1
83+
expectEvents:
84+
- client: *client
85+
eventType: cmap
86+
events:
87+
- poolClearedEvent: {}
88+
- connectionCheckedInEvent: {}

0 commit comments

Comments
 (0)