Skip to content

Commit cfb0bbd

Browse files
test(NODE-7367): sync new SDAM backpressure tests (#4866)
1 parent 311cc77 commit cfb0bbd

8 files changed

+900
-0
lines changed
Lines changed: 142 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,142 @@
1+
{
2+
"description": "backpressure-network-error-fail-replicaset",
3+
"schemaVersion": "1.17",
4+
"runOnRequirements": [
5+
{
6+
"minServerVersion": "4.4",
7+
"serverless": "forbid",
8+
"topologies": [
9+
"replicaset"
10+
]
11+
}
12+
],
13+
"createEntities": [
14+
{
15+
"client": {
16+
"id": "setupClient",
17+
"useMultipleMongoses": false
18+
}
19+
}
20+
],
21+
"initialData": [
22+
{
23+
"collectionName": "backpressure-network-error-fail",
24+
"databaseName": "sdam-tests",
25+
"documents": [
26+
{
27+
"_id": 1
28+
},
29+
{
30+
"_id": 2
31+
}
32+
]
33+
}
34+
],
35+
"tests": [
36+
{
37+
"description": "apply backpressure on network connection errors during connection establishment",
38+
"operations": [
39+
{
40+
"name": "createEntities",
41+
"object": "testRunner",
42+
"arguments": {
43+
"entities": [
44+
{
45+
"client": {
46+
"id": "client",
47+
"useMultipleMongoses": false,
48+
"observeEvents": [
49+
"serverDescriptionChangedEvent",
50+
"poolClearedEvent"
51+
],
52+
"uriOptions": {
53+
"retryWrites": false,
54+
"heartbeatFrequencyMS": 1000000,
55+
"serverMonitoringMode": "poll",
56+
"appname": "backpressureNetworkErrorFailTest"
57+
}
58+
}
59+
},
60+
{
61+
"database": {
62+
"id": "database",
63+
"client": "client",
64+
"databaseName": "sdam-tests"
65+
}
66+
},
67+
{
68+
"collection": {
69+
"id": "collection",
70+
"database": "database",
71+
"collectionName": "backpressure-network-error-fail"
72+
}
73+
}
74+
]
75+
}
76+
},
77+
{
78+
"name": "waitForEvent",
79+
"object": "testRunner",
80+
"arguments": {
81+
"client": "client",
82+
"event": {
83+
"serverDescriptionChangedEvent": {
84+
"newDescription": {
85+
"type": "RSPrimary"
86+
}
87+
}
88+
},
89+
"count": 1
90+
}
91+
},
92+
{
93+
"name": "failPoint",
94+
"object": "testRunner",
95+
"arguments": {
96+
"client": "setupClient",
97+
"failPoint": {
98+
"configureFailPoint": "failCommand",
99+
"mode": "alwaysOn",
100+
"data": {
101+
"failCommands": [
102+
"isMaster",
103+
"hello"
104+
],
105+
"appName": "backpressureNetworkErrorFailTest",
106+
"closeConnection": true
107+
}
108+
}
109+
}
110+
},
111+
{
112+
"name": "insertMany",
113+
"object": "collection",
114+
"arguments": {
115+
"documents": [
116+
{
117+
"_id": 3
118+
},
119+
{
120+
"_id": 4
121+
}
122+
]
123+
},
124+
"expectError": {
125+
"isError": true,
126+
"errorLabelsContain": [
127+
"SystemOverloadedError",
128+
"RetryableError"
129+
]
130+
}
131+
}
132+
],
133+
"expectEvents": [
134+
{
135+
"client": "client",
136+
"eventType": "cmap",
137+
"events": []
138+
}
139+
]
140+
}
141+
]
142+
}
Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
description: backpressure-network-error-fail-replicaset
2+
schemaVersion: "1.17"
3+
runOnRequirements:
4+
- minServerVersion: "4.4"
5+
serverless: forbid
6+
topologies:
7+
- replicaset
8+
createEntities:
9+
- client:
10+
id: setupClient
11+
useMultipleMongoses: false
12+
initialData:
13+
- collectionName: backpressure-network-error-fail
14+
databaseName: sdam-tests
15+
documents:
16+
- _id: 1
17+
- _id: 2
18+
tests:
19+
- description: apply backpressure on network connection errors during connection establishment
20+
operations:
21+
- name: createEntities
22+
object: testRunner
23+
arguments:
24+
entities:
25+
- client:
26+
id: client
27+
useMultipleMongoses: false
28+
observeEvents:
29+
- serverDescriptionChangedEvent
30+
- poolClearedEvent
31+
uriOptions:
32+
retryWrites: false
33+
heartbeatFrequencyMS: 1000000
34+
serverMonitoringMode: poll
35+
appname: backpressureNetworkErrorFailTest
36+
- database:
37+
id: database
38+
client: client
39+
databaseName: sdam-tests
40+
- collection:
41+
id: collection
42+
database: database
43+
collectionName: backpressure-network-error-fail
44+
- name: waitForEvent
45+
object: testRunner
46+
arguments:
47+
client: client
48+
event:
49+
serverDescriptionChangedEvent:
50+
newDescription:
51+
type: RSPrimary
52+
count: 1
53+
- name: failPoint
54+
object: testRunner
55+
arguments:
56+
client: setupClient
57+
failPoint:
58+
configureFailPoint: failCommand
59+
mode: alwaysOn
60+
data:
61+
failCommands:
62+
- isMaster
63+
- hello
64+
appName: backpressureNetworkErrorFailTest
65+
closeConnection: true
66+
- name: insertMany
67+
object: collection
68+
arguments:
69+
documents:
70+
- _id: 3
71+
- _id: 4
72+
expectError:
73+
isError: true
74+
errorLabelsContain:
75+
- SystemOverloadedError
76+
- RetryableError
77+
expectEvents:
78+
- client: client
79+
eventType: cmap
80+
events: []
Lines changed: 142 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,142 @@
1+
{
2+
"description": "backpressure-network-error-fail-single",
3+
"schemaVersion": "1.17",
4+
"runOnRequirements": [
5+
{
6+
"minServerVersion": "4.4",
7+
"serverless": "forbid",
8+
"topologies": [
9+
"single"
10+
]
11+
}
12+
],
13+
"createEntities": [
14+
{
15+
"client": {
16+
"id": "setupClient",
17+
"useMultipleMongoses": false
18+
}
19+
}
20+
],
21+
"initialData": [
22+
{
23+
"collectionName": "backpressure-network-error-fail",
24+
"databaseName": "sdam-tests",
25+
"documents": [
26+
{
27+
"_id": 1
28+
},
29+
{
30+
"_id": 2
31+
}
32+
]
33+
}
34+
],
35+
"tests": [
36+
{
37+
"description": "apply backpressure on network connection errors during connection establishment",
38+
"operations": [
39+
{
40+
"name": "createEntities",
41+
"object": "testRunner",
42+
"arguments": {
43+
"entities": [
44+
{
45+
"client": {
46+
"id": "client",
47+
"useMultipleMongoses": false,
48+
"observeEvents": [
49+
"serverDescriptionChangedEvent",
50+
"poolClearedEvent"
51+
],
52+
"uriOptions": {
53+
"retryWrites": false,
54+
"heartbeatFrequencyMS": 1000000,
55+
"serverMonitoringMode": "poll",
56+
"appname": "backpressureNetworkErrorFailTest"
57+
}
58+
}
59+
},
60+
{
61+
"database": {
62+
"id": "database",
63+
"client": "client",
64+
"databaseName": "sdam-tests"
65+
}
66+
},
67+
{
68+
"collection": {
69+
"id": "collection",
70+
"database": "database",
71+
"collectionName": "backpressure-network-error-fail"
72+
}
73+
}
74+
]
75+
}
76+
},
77+
{
78+
"name": "waitForEvent",
79+
"object": "testRunner",
80+
"arguments": {
81+
"client": "client",
82+
"event": {
83+
"serverDescriptionChangedEvent": {
84+
"newDescription": {
85+
"type": "Standalone"
86+
}
87+
}
88+
},
89+
"count": 1
90+
}
91+
},
92+
{
93+
"name": "failPoint",
94+
"object": "testRunner",
95+
"arguments": {
96+
"client": "setupClient",
97+
"failPoint": {
98+
"configureFailPoint": "failCommand",
99+
"mode": "alwaysOn",
100+
"data": {
101+
"failCommands": [
102+
"isMaster",
103+
"hello"
104+
],
105+
"appName": "backpressureNetworkErrorFailTest",
106+
"closeConnection": true
107+
}
108+
}
109+
}
110+
},
111+
{
112+
"name": "insertMany",
113+
"object": "collection",
114+
"arguments": {
115+
"documents": [
116+
{
117+
"_id": 3
118+
},
119+
{
120+
"_id": 4
121+
}
122+
]
123+
},
124+
"expectError": {
125+
"isError": true,
126+
"errorLabelsContain": [
127+
"SystemOverloadedError",
128+
"RetryableError"
129+
]
130+
}
131+
}
132+
],
133+
"expectEvents": [
134+
{
135+
"client": "client",
136+
"eventType": "cmap",
137+
"events": []
138+
}
139+
]
140+
}
141+
]
142+
}

0 commit comments

Comments
 (0)