Skip to content

Commit d3b0637

Browse files
sync new spec tests
1 parent 9a388d7 commit d3b0637

File tree

8 files changed

+553
-12
lines changed

8 files changed

+553
-12
lines changed

test/spec/connection-monitoring-and-pooling/cmap-format/pool-create-min-size-error.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
"isMaster",
1818
"hello"
1919
],
20-
"closeConnection": true,
20+
"errorCode": 91,
2121
"appName": "poolCreateMinSizeErrorTest"
2222
}
2323
},

test/spec/connection-monitoring-and-pooling/cmap-format/pool-create-min-size-error.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ failPoint:
1111
mode: { times: 50 }
1212
data:
1313
failCommands: ["isMaster","hello"]
14-
closeConnection: true
14+
errorCode: 91
1515
appName: "poolCreateMinSizeErrorTest"
1616
poolOptions:
1717
minPoolSize: 1

test/spec/load-balancers/sdam-error-handling.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"description": "state change errors are correctly handled",
3-
"schemaVersion": "1.3",
3+
"schemaVersion": "1.4",
44
"runOnRequirements": [
55
{
66
"topologies": [
@@ -263,7 +263,7 @@
263263
"description": "errors during the initial connection hello are ignored",
264264
"runOnRequirements": [
265265
{
266-
"minServerVersion": "4.9"
266+
"minServerVersion": "4.4.7"
267267
}
268268
],
269269
"operations": [
@@ -282,7 +282,7 @@
282282
"isMaster",
283283
"hello"
284284
],
285-
"closeConnection": true,
285+
"errorCode": 11600,
286286
"appName": "lbSDAMErrorTestClient"
287287
}
288288
}
@@ -297,7 +297,7 @@
297297
}
298298
},
299299
"expectError": {
300-
"isClientError": true
300+
"isError": true
301301
}
302302
}
303303
],

test/spec/load-balancers/sdam-error-handling.yml

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
description: state change errors are correctly handled
22

3-
schemaVersion: '1.3'
3+
schemaVersion: '1.4'
44

55
runOnRequirements:
66
- topologies: [ load-balanced ]
@@ -141,9 +141,8 @@ tests:
141141
# to the same mongos on which the failpoint is set.
142142
- description: errors during the initial connection hello are ignored
143143
runOnRequirements:
144-
# Server version 4.9+ is needed to set a fail point on the initial
145-
# connection handshake with the appName filter due to SERVER-49336.
146-
- minServerVersion: '4.9'
144+
# Require SERVER-49336 for failCommand + appName on the initial handshake.
145+
- minServerVersion: '4.4.7'
147146
operations:
148147
- name: failPoint
149148
object: testRunner
@@ -154,14 +153,14 @@ tests:
154153
mode: { times: 1 }
155154
data:
156155
failCommands: [isMaster, hello]
157-
closeConnection: true
156+
errorCode: 11600
158157
appName: *singleClientAppName
159158
- name: insertOne
160159
object: *singleColl
161160
arguments:
162161
document: { x: 1 }
163162
expectError:
164-
isClientError: true
163+
isError: true
165164
expectEvents:
166165
- client: *singleClient
167166
eventType: cmap
Lines changed: 171 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,171 @@
1+
{
2+
"description": "backpressure-network-error-fail",
3+
"schemaVersion": "1.17",
4+
"runOnRequirements": [
5+
{
6+
"minServerVersion": "4.4",
7+
"serverless": "forbid",
8+
"topologies": [
9+
"single",
10+
"replicaset",
11+
"sharded"
12+
]
13+
}
14+
],
15+
"createEntities": [
16+
{
17+
"client": {
18+
"id": "setupClient",
19+
"useMultipleMongoses": false
20+
}
21+
}
22+
],
23+
"initialData": [
24+
{
25+
"collectionName": "backpressure-network-error-fail",
26+
"databaseName": "sdam-tests",
27+
"documents": [
28+
{
29+
"_id": 1
30+
},
31+
{
32+
"_id": 2
33+
}
34+
]
35+
}
36+
],
37+
"tests": [
38+
{
39+
"description": "apply backpressure on network connection errors during connection establishment",
40+
"operations": [
41+
{
42+
"name": "createEntities",
43+
"object": "testRunner",
44+
"arguments": {
45+
"entities": [
46+
{
47+
"client": {
48+
"id": "client",
49+
"useMultipleMongoses": false,
50+
"observeEvents": [
51+
"serverHeartbeatSucceededEvent",
52+
"serverDescriptionChangedEvent",
53+
"poolReadyEvent",
54+
"poolClearedEvent"
55+
],
56+
"uriOptions": {
57+
"retryWrites": false,
58+
"heartbeatFrequencyMS": 10000,
59+
"serverMonitoringMode": "poll",
60+
"directConnection": true,
61+
"appname": "backpressureNetworkErrorFailTest"
62+
}
63+
}
64+
},
65+
{
66+
"database": {
67+
"id": "database",
68+
"client": "client",
69+
"databaseName": "sdam-tests"
70+
}
71+
},
72+
{
73+
"collection": {
74+
"id": "collection",
75+
"database": "database",
76+
"collectionName": "backpressure-network-error-fail"
77+
}
78+
}
79+
]
80+
}
81+
},
82+
{
83+
"name": "waitForEvent",
84+
"object": "testRunner",
85+
"arguments": {
86+
"client": "client",
87+
"event": {
88+
"serverHeartbeatSucceededEvent": {}
89+
},
90+
"count": 1
91+
}
92+
},
93+
{
94+
"name": "waitForEvent",
95+
"object": "testRunner",
96+
"arguments": {
97+
"client": "client",
98+
"event": {
99+
"serverDescriptionChangedEvent": {}
100+
},
101+
"count": 1
102+
}
103+
},
104+
{
105+
"name": "failPoint",
106+
"object": "testRunner",
107+
"arguments": {
108+
"client": "setupClient",
109+
"failPoint": {
110+
"configureFailPoint": "failCommand",
111+
"mode": "alwaysOn",
112+
"data": {
113+
"failCommands": [
114+
"isMaster",
115+
"hello"
116+
],
117+
"appName": "backpressureNetworkErrorFailTest",
118+
"closeConnection": true
119+
}
120+
}
121+
}
122+
},
123+
{
124+
"name": "insertMany",
125+
"object": "collection",
126+
"arguments": {
127+
"documents": [
128+
{
129+
"_id": 3
130+
},
131+
{
132+
"_id": 4
133+
}
134+
]
135+
},
136+
"expectError": {
137+
"isError": true,
138+
"errorLabelsContain": [
139+
"SystemOverloadedError",
140+
"RetryableError"
141+
]
142+
}
143+
}
144+
],
145+
"expectEvents": [
146+
{
147+
"client": "client",
148+
"eventType": "cmap",
149+
"events": [
150+
{
151+
"poolReadyEvent": {}
152+
}
153+
]
154+
},
155+
{
156+
"client": "client",
157+
"eventType": "sdam",
158+
"ignoreExtraEvents": false,
159+
"events": [
160+
{
161+
"serverHeartbeatSucceededEvent": {}
162+
},
163+
{
164+
"serverDescriptionChangedEvent": {}
165+
}
166+
]
167+
}
168+
]
169+
}
170+
]
171+
}
Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
description: backpressure-network-error-fail
2+
schemaVersion: "1.17"
3+
runOnRequirements:
4+
- minServerVersion: "4.4"
5+
serverless: forbid
6+
topologies:
7+
- single
8+
- replicaset
9+
- sharded
10+
createEntities:
11+
- client:
12+
id: setupClient
13+
useMultipleMongoses: false
14+
initialData:
15+
- collectionName: backpressure-network-error-fail
16+
databaseName: sdam-tests
17+
documents:
18+
- _id: 1
19+
- _id: 2
20+
tests:
21+
- description: apply backpressure on network connection errors during connection establishment
22+
operations:
23+
- name: createEntities
24+
object: testRunner
25+
arguments:
26+
entities:
27+
- client:
28+
id: client
29+
useMultipleMongoses: false
30+
observeEvents:
31+
- serverHeartbeatSucceededEvent
32+
- serverDescriptionChangedEvent
33+
- poolReadyEvent
34+
- poolClearedEvent
35+
uriOptions:
36+
retryWrites: false
37+
heartbeatFrequencyMS: 10000
38+
serverMonitoringMode: poll
39+
directConnection: true
40+
appname: backpressureNetworkErrorFailTest
41+
- database:
42+
id: database
43+
client: client
44+
databaseName: sdam-tests
45+
- collection:
46+
id: collection
47+
database: database
48+
collectionName: backpressure-network-error-fail
49+
- name: waitForEvent
50+
object: testRunner
51+
arguments:
52+
client: client
53+
event:
54+
serverHeartbeatSucceededEvent: {}
55+
count: 1
56+
- name: waitForEvent
57+
object: testRunner
58+
arguments:
59+
client: client
60+
event:
61+
serverDescriptionChangedEvent: {}
62+
count: 1
63+
- name: failPoint
64+
object: testRunner
65+
arguments:
66+
client: setupClient
67+
failPoint:
68+
configureFailPoint: failCommand
69+
mode: alwaysOn
70+
data:
71+
failCommands:
72+
- isMaster
73+
- hello
74+
appName: backpressureNetworkErrorFailTest
75+
closeConnection: true
76+
- name: insertMany
77+
object: collection
78+
arguments:
79+
documents:
80+
- _id: 3
81+
- _id: 4
82+
expectError:
83+
isError: true
84+
errorLabelsContain:
85+
- SystemOverloadedError
86+
- RetryableError
87+
expectEvents:
88+
- client: client
89+
eventType: cmap
90+
events:
91+
- poolReadyEvent: {}
92+
- client: client
93+
eventType: sdam
94+
ignoreExtraEvents: false
95+
events:
96+
- serverHeartbeatSucceededEvent: {}
97+
- serverDescriptionChangedEvent: {}

0 commit comments

Comments
 (0)