Skip to content

Commit 9768640

Browse files
test(NODE-7343): sync latest SDAM backpressure tests (#4827)
1 parent cc503cb commit 9768640

6 files changed

Lines changed: 171 additions & 94 deletions

test/spec/server-discovery-and-monitoring/unified/backpressure-server-description-unchanged-on-min-pool-size-population-error.json

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,27 @@
2222
{
2323
"description": "the server description is not changed on handshake error during minPoolSize population",
2424
"operations": [
25+
{
26+
"name": "failPoint",
27+
"object": "testRunner",
28+
"arguments": {
29+
"client": "setupClient",
30+
"failPoint": {
31+
"configureFailPoint": "failCommand",
32+
"mode": {
33+
"skip": 1
34+
},
35+
"data": {
36+
"failCommands": [
37+
"hello",
38+
"isMaster"
39+
],
40+
"appName": "authErrorTest",
41+
"closeConnection": true
42+
}
43+
}
44+
}
45+
},
2546
{
2647
"name": "createEntities",
2748
"object": "testRunner",
@@ -46,27 +67,6 @@
4667
]
4768
}
4869
},
49-
{
50-
"name": "failPoint",
51-
"object": "testRunner",
52-
"arguments": {
53-
"client": "setupClient",
54-
"failPoint": {
55-
"configureFailPoint": "failCommand",
56-
"mode": {
57-
"skip": 1
58-
},
59-
"data": {
60-
"failCommands": [
61-
"hello",
62-
"isMaster"
63-
],
64-
"appName": "authErrorTest",
65-
"closeConnection": true
66-
}
67-
}
68-
}
69-
},
7070
{
7171
"name": "waitForEvent",
7272
"object": "testRunner",

test/spec/server-discovery-and-monitoring/unified/backpressure-server-description-unchanged-on-min-pool-size-population-error.yml

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,20 @@ createEntities:
1212
tests:
1313
- description: the server description is not changed on handshake error during minPoolSize population
1414
operations:
15+
- name: failPoint
16+
object: testRunner
17+
arguments:
18+
client: setupClient
19+
failPoint:
20+
configureFailPoint: failCommand
21+
mode:
22+
skip: 1
23+
data:
24+
failCommands:
25+
- hello
26+
- isMaster
27+
appName: authErrorTest
28+
closeConnection: true
1529
- name: createEntities
1630
object: testRunner
1731
arguments:
@@ -27,20 +41,6 @@ tests:
2741
maxConnecting: 1
2842
serverMonitoringMode: poll
2943
heartbeatFrequencyMS: 1000000
30-
- name: failPoint
31-
object: testRunner
32-
arguments:
33-
client: setupClient
34-
failPoint:
35-
configureFailPoint: failCommand
36-
mode:
37-
skip: 1
38-
data:
39-
failCommands:
40-
- hello
41-
- isMaster
42-
appName: authErrorTest
43-
closeConnection: true
4444
- name: waitForEvent
4545
object: testRunner
4646
arguments:

test/spec/server-discovery-and-monitoring/unified/minPoolSize-error.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"schemaVersion": "1.4",
44
"runOnRequirements": [
55
{
6-
"minServerVersion": "4.9",
6+
"minServerVersion": "4.4.7",
77
"serverless": "forbid",
88
"topologies": [
99
"single"
@@ -27,7 +27,7 @@
2727
],
2828
"tests": [
2929
{
30-
"description": "Network error on minPoolSize background creation",
30+
"description": "Server error on minPoolSize background creation",
3131
"operations": [
3232
{
3333
"name": "failPoint",
@@ -45,7 +45,7 @@
4545
"isMaster"
4646
],
4747
"appName": "SDAMminPoolSizeError",
48-
"closeConnection": true
48+
"errorCode": 91
4949
}
5050
}
5151
}
@@ -68,6 +68,7 @@
6868
"heartbeatFrequencyMS": 10000,
6969
"appname": "SDAMminPoolSizeError",
7070
"minPoolSize": 10,
71+
"serverMonitoringMode": "poll",
7172
"serverSelectionTimeoutMS": 1000
7273
}
7374
}

test/spec/server-discovery-and-monitoring/unified/minPoolSize-error.yml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ description: minPoolSize-error
44
schemaVersion: "1.4"
55

66
runOnRequirements:
7-
# failCommand appName requirements
8-
- minServerVersion: "4.9"
7+
# Require SERVER-49336 for failCommand + appName on the initial handshake.
8+
- minServerVersion: "4.4.7"
99
serverless: forbid
1010
topologies:
1111
- single
@@ -21,7 +21,7 @@ initialData: &initialData
2121
documents: []
2222

2323
tests:
24-
- description: Network error on minPoolSize background creation
24+
- description: Server error on minPoolSize background creation
2525
operations:
2626
# Configure the initial monitor handshake to succeed but the
2727
# first or second background minPoolSize establishments to fail.
@@ -38,7 +38,7 @@ tests:
3838
- hello
3939
- isMaster
4040
appName: SDAMminPoolSizeError
41-
closeConnection: true
41+
errorCode: 91
4242
- name: createEntities
4343
object: testRunner
4444
arguments:
@@ -54,6 +54,7 @@ tests:
5454
heartbeatFrequencyMS: 10000
5555
appname: SDAMminPoolSizeError
5656
minPoolSize: 10
57+
serverMonitoringMode: poll
5758
serverSelectionTimeoutMS: 1000
5859
- database:
5960
id: &database database

test/spec/server-discovery-and-monitoring/unified/pool-clear-min-pool-size-error.json

Lines changed: 91 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@
5656
"client": {
5757
"id": "client",
5858
"observeEvents": [
59-
"connectionCreatedEvent",
59+
"poolReadyEvent",
6060
"poolClearedEvent",
6161
"connectionClosedEvent"
6262
],
@@ -69,6 +69,17 @@
6969
]
7070
}
7171
},
72+
{
73+
"name": "waitForEvent",
74+
"object": "testRunner",
75+
"arguments": {
76+
"client": "client",
77+
"event": {
78+
"poolReadyEvent": {}
79+
},
80+
"count": 1
81+
}
82+
},
7283
{
7384
"name": "waitForEvent",
7485
"object": "testRunner",
@@ -91,22 +102,89 @@
91102
"count": 1
92103
}
93104
}
94-
],
95-
"expectEvents": [
105+
]
106+
},
107+
{
108+
"description": "Pool is not cleared on handshake error during minPoolSize population",
109+
"operations": [
110+
{
111+
"name": "failPoint",
112+
"object": "testRunner",
113+
"arguments": {
114+
"client": "setupClient",
115+
"failPoint": {
116+
"configureFailPoint": "failCommand",
117+
"mode": {
118+
"skip": 1
119+
},
120+
"data": {
121+
"failCommands": [
122+
"hello",
123+
"isMaster"
124+
],
125+
"appName": "authErrorTest",
126+
"closeConnection": true
127+
}
128+
}
129+
}
130+
},
131+
{
132+
"name": "createEntities",
133+
"object": "testRunner",
134+
"arguments": {
135+
"entities": [
136+
{
137+
"client": {
138+
"id": "client",
139+
"observeEvents": [
140+
"poolReadyEvent",
141+
"poolClearedEvent",
142+
"connectionClosedEvent"
143+
],
144+
"uriOptions": {
145+
"appname": "authErrorTest",
146+
"minPoolSize": 5,
147+
"maxConnecting": 1,
148+
"serverMonitoringMode": "poll",
149+
"heartbeatFrequencyMS": 1000000
150+
}
151+
}
152+
}
153+
]
154+
}
155+
},
96156
{
97-
"client": "client",
98-
"eventType": "cmap",
99-
"events": [
100-
{
101-
"connectionCreatedEvent": {}
157+
"name": "waitForEvent",
158+
"object": "testRunner",
159+
"arguments": {
160+
"client": "client",
161+
"event": {
162+
"poolReadyEvent": {}
102163
},
103-
{
164+
"count": 1
165+
}
166+
},
167+
{
168+
"name": "waitForEvent",
169+
"object": "testRunner",
170+
"arguments": {
171+
"client": "client",
172+
"event": {
173+
"connectionClosedEvent": {}
174+
},
175+
"count": 1
176+
}
177+
},
178+
{
179+
"name": "assertEventCount",
180+
"object": "testRunner",
181+
"arguments": {
182+
"client": "client",
183+
"event": {
104184
"poolClearedEvent": {}
105185
},
106-
{
107-
"connectionClosedEvent": {}
108-
}
109-
]
186+
"count": 0
187+
}
110188
}
111189
]
112190
}

0 commit comments

Comments
 (0)