Skip to content

Commit 58602c7

Browse files
committed
update sdam tests
1 parent 25ab418 commit 58602c7

File tree

2 files changed

+36
-76
lines changed

2 files changed

+36
-76
lines changed

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

Lines changed: 15 additions & 70 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
],
3838
"tests": [
3939
{
40-
"description": "Reset server and pool after network error during authentication",
40+
"description": "Backoff and retry after network connection error during authentication",
4141
"operations": [
4242
{
4343
"name": "failPoint",
@@ -47,13 +47,13 @@
4747
"failPoint": {
4848
"configureFailPoint": "failCommand",
4949
"mode": {
50-
"times": 1
50+
"times": 2
5151
},
5252
"data": {
5353
"failCommands": [
5454
"saslContinue"
5555
],
56-
"errorCode": 18,
56+
"closeConnection": true,
5757
"appName": "authNetworkErrorTest"
5858
}
5959
}
@@ -70,14 +70,15 @@
7070
"useMultipleMongoses": false,
7171
"observeEvents": [
7272
"commandStartedEvent",
73-
"serverDescriptionChangedEvent",
74-
"poolClearedEvent"
73+
"poolBackoffEvent",
74+
"poolReadyEvent",
75+
"poolClearEvent"
7576
],
7677
"uriOptions": {
7778
"retryWrites": false,
78-
"socketTimeoutMS": 500,
79-
"connectTimeoutMS": 500,
80-
"appname": "authNetworkErrorTest"
79+
"appname": "authNetworkErrorTest",
80+
"connectTimeoutMS": 250,
81+
"socketTimeoutMS": 250
8182
}
8283
}
8384
},
@@ -110,9 +111,6 @@
110111
"_id": 4
111112
}
112113
]
113-
},
114-
"expectError": {
115-
"isError": true
116114
}
117115
},
118116
{
@@ -121,65 +119,12 @@
121119
"arguments": {
122120
"client": "client",
123121
"event": {
124-
"serverDescriptionChangedEvent": {
125-
"newDescription": {
126-
"type": "Unknown"
127-
}
122+
"poolBackoffEvent": {
123+
"attempt": 1
128124
}
129125
},
130126
"count": 1
131127
}
132-
},
133-
{
134-
"name": "waitForEvent",
135-
"object": "testRunner",
136-
"arguments": {
137-
"client": "client",
138-
"event": {
139-
"poolClearedEvent": {}
140-
},
141-
"count": 1
142-
}
143-
},
144-
{
145-
"name": "insertMany",
146-
"object": "collection",
147-
"arguments": {
148-
"documents": [
149-
{
150-
"_id": 5
151-
},
152-
{
153-
"_id": 6
154-
}
155-
]
156-
}
157-
},
158-
{
159-
"name": "assertEventCount",
160-
"object": "testRunner",
161-
"arguments": {
162-
"client": "client",
163-
"event": {
164-
"serverDescriptionChangedEvent": {
165-
"newDescription": {
166-
"type": "Unknown"
167-
}
168-
}
169-
},
170-
"count": 1
171-
}
172-
},
173-
{
174-
"name": "assertEventCount",
175-
"object": "testRunner",
176-
"arguments": {
177-
"client": "client",
178-
"event": {
179-
"poolClearedEvent": {}
180-
},
181-
"count": 1
182-
}
183128
}
184129
],
185130
"expectEvents": [
@@ -193,10 +138,10 @@
193138
"insert": "auth-network-error",
194139
"documents": [
195140
{
196-
"_id": 5
141+
"_id": 3
197142
},
198143
{
199-
"_id": 6
144+
"_id": 4
200145
}
201146
]
202147
},
@@ -219,10 +164,10 @@
219164
"_id": 2
220165
},
221166
{
222-
"_id": 5
167+
"_id": 3
223168
},
224169
{
225-
"_id": 6
170+
"_id": 4
226171
}
227172
]
228173
}

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

Lines changed: 21 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
],
3838
"tests": [
3939
{
40-
"description": "Reset server and pool after network timeout error during authentication",
40+
"description": "Backoff and retry after network timeout error during authentication",
4141
"operations": [
4242
{
4343
"name": "failPoint",
@@ -47,14 +47,13 @@
4747
"failPoint": {
4848
"configureFailPoint": "failCommand",
4949
"mode": {
50-
"times": 1
50+
"times": 2
5151
},
5252
"data": {
5353
"failCommands": [
5454
"saslContinue"
5555
],
56-
"blockConnection": true,
57-
"blockTimeMS": 500,
56+
"closeConnection": true,
5857
"appName": "authNetworkTimeoutErrorTest"
5958
}
6059
}
@@ -72,7 +71,8 @@
7271
"observeEvents": [
7372
"commandStartedEvent",
7473
"poolBackoffEvent",
75-
"poolReadyEvent"
74+
"poolReadyEvent",
75+
"poolClearEvent"
7676
],
7777
"uriOptions": {
7878
"retryWrites": false,
@@ -119,7 +119,22 @@
119119
"arguments": {
120120
"client": "client",
121121
"event": {
122-
"poolBackoffEvent": {}
122+
"poolBackoffEvent": {
123+
"attempt": 1
124+
}
125+
},
126+
"count": 1
127+
}
128+
},
129+
{
130+
"name": "waitForEvent",
131+
"object": "testRunner",
132+
"arguments": {
133+
"client": "client",
134+
"event": {
135+
"poolBackoffEvent": {
136+
"attempt": 2
137+
}
123138
},
124139
"count": 1
125140
}

0 commit comments

Comments
 (0)