Skip to content

Commit 873d1f1

Browse files
committed
add test that transitions from backoff to clear
1 parent f67195e commit 873d1f1

File tree

3 files changed

+153
-4
lines changed

3 files changed

+153
-4
lines changed

test/discovery_and_monitoring/unified/auth-network-error-fail.json

Lines changed: 151 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
],
3838
"tests": [
3939
{
40-
"description": "Backoff and fail after network connection error during authentication",
40+
"description": "Backoff and fail after network connection errors during authentication",
4141
"operations": [
4242
{
4343
"name": "failPoint",
@@ -72,7 +72,7 @@
7272
"commandStartedEvent",
7373
"poolBackoffEvent",
7474
"poolReadyEvent",
75-
"poolClearEvent"
75+
"poolClearedEvent"
7676
],
7777
"uriOptions": {
7878
"retryWrites": false,
@@ -149,6 +149,155 @@
149149
]
150150
}
151151
]
152+
},
153+
{
154+
"description": "Backoff and clear the pool after network failures followed by server error",
155+
"operations": [
156+
{
157+
"name": "failPoint",
158+
"object": "testRunner",
159+
"arguments": {
160+
"client": "setupClient",
161+
"failPoint": {
162+
"configureFailPoint": "failCommand",
163+
"mode": {
164+
"times": 6
165+
},
166+
"data": {
167+
"failCommands": [
168+
"saslContinue"
169+
],
170+
"appName": "authNetworkErrorFailTest",
171+
"closeConnection": true
172+
}
173+
}
174+
}
175+
},
176+
{
177+
"name": "createEntities",
178+
"object": "testRunner",
179+
"arguments": {
180+
"entities": [
181+
{
182+
"client": {
183+
"id": "client",
184+
"useMultipleMongoses": false,
185+
"observeEvents": [
186+
"commandStartedEvent",
187+
"poolBackoffEvent",
188+
"poolReadyEvent",
189+
"poolClearedEvent"
190+
],
191+
"uriOptions": {
192+
"retryWrites": false,
193+
"appname": "authNetworkErrorFailTest"
194+
}
195+
}
196+
},
197+
{
198+
"database": {
199+
"id": "database",
200+
"client": "client",
201+
"databaseName": "sdam-tests"
202+
}
203+
},
204+
{
205+
"collection": {
206+
"id": "collection",
207+
"database": "database",
208+
"collectionName": "auth-network-error-fail"
209+
}
210+
}
211+
]
212+
}
213+
},
214+
{
215+
"name": "insertMany",
216+
"object": "collection",
217+
"arguments": {
218+
"documents": [
219+
{
220+
"_id": 3
221+
},
222+
{
223+
"_id": 4
224+
}
225+
]
226+
},
227+
"expectError": {
228+
"isError": true
229+
}
230+
},
231+
{
232+
"name": "failPoint",
233+
"object": "testRunner",
234+
"arguments": {
235+
"client": "setupClient",
236+
"failPoint": {
237+
"configureFailPoint": "failCommand",
238+
"mode": {
239+
"times": 1
240+
},
241+
"data": {
242+
"failCommands": [
243+
"saslContinue"
244+
],
245+
"appName": "authNetworkErrorFailTest",
246+
"errorCode": 18
247+
}
248+
}
249+
}
250+
},
251+
{
252+
"name": "insertOne",
253+
"object": "collection",
254+
"arguments": {
255+
"document": {
256+
"_id": 3
257+
}
258+
},
259+
"expectError": {
260+
"isError": true
261+
}
262+
}
263+
],
264+
"expectEvents": [
265+
{
266+
"client": "client",
267+
"eventType": "command",
268+
"events": []
269+
},
270+
{
271+
"client": "client",
272+
"eventType": "cmap",
273+
"events": [
274+
{
275+
"poolReadyEvent": {}
276+
},
277+
{
278+
"poolBackoffEvent": {}
279+
},
280+
{
281+
"poolBackoffEvent": {}
282+
},
283+
{
284+
"poolBackoffEvent": {}
285+
},
286+
{
287+
"poolBackoffEvent": {}
288+
},
289+
{
290+
"poolBackoffEvent": {}
291+
},
292+
{
293+
"poolBackoffEvent": {}
294+
},
295+
{
296+
"poolClearedEvent": {}
297+
}
298+
]
299+
}
300+
]
152301
}
153302
]
154303
}

test/discovery_and_monitoring/unified/auth-network-error.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@
7272
"commandStartedEvent",
7373
"poolBackoffEvent",
7474
"poolReadyEvent",
75-
"poolClearEvent"
75+
"poolClearedEvent"
7676
],
7777
"uriOptions": {
7878
"retryWrites": false,

test/discovery_and_monitoring/unified/auth-network-timeout-error.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@
7272
"commandStartedEvent",
7373
"poolBackoffEvent",
7474
"poolReadyEvent",
75-
"poolClearEvent"
75+
"poolClearedEvent"
7676
],
7777
"uriOptions": {
7878
"retryWrites": false,

0 commit comments

Comments
 (0)