Skip to content

Commit 417655a

Browse files
authored
revert(NODE-4414): Improve reliability of SDAM heartbeat error spec tests (#3346)
1 parent 753ecfe commit 417655a

File tree

6 files changed

+69
-45
lines changed

6 files changed

+69
-45
lines changed

test/spec/server-discovery-and-monitoring/integration/hello-command-error.json

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@
117117
"failPoint": {
118118
"configureFailPoint": "failCommand",
119119
"mode": {
120-
"times": 4
120+
"times": 2
121121
},
122122
"data": {
123123
"failCommands": [
@@ -162,6 +162,22 @@
162162
}
163163
]
164164
}
165+
},
166+
{
167+
"name": "assertEventCount",
168+
"object": "testRunner",
169+
"arguments": {
170+
"event": "ServerMarkedUnknownEvent",
171+
"count": 1
172+
}
173+
},
174+
{
175+
"name": "assertEventCount",
176+
"object": "testRunner",
177+
"arguments": {
178+
"event": "PoolClearedEvent",
179+
"count": 1
180+
}
165181
}
166182
],
167183
"expectations": [

test/spec/server-discovery-and-monitoring/integration/hello-command-error.yml

Lines changed: 15 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -84,16 +84,15 @@ tests:
8484
documents:
8585
- _id: 1
8686
- _id: 2
87-
# Configure the next streaming hello check to fail with a command error.
88-
# Use "times: 4" to increase the probability that the Monitor check fails
89-
# since the RTT hello may trigger this failpoint one or many times as
90-
# well.
87+
# Configure the next streaming hello check to fail with a command
88+
# error.
89+
# Use times: 2 so that the RTT hello is blocked as well.
9190
- name: configureFailPoint
9291
object: testRunner
9392
arguments:
9493
failPoint:
9594
configureFailPoint: failCommand
96-
mode: { times: 4 }
95+
mode: { times: 2 }
9796
data:
9897
failCommands: ["hello", "isMaster"]
9998
appName: commandErrorCheckTest
@@ -120,19 +119,17 @@ tests:
120119
documents:
121120
- _id: 3
122121
- _id: 4
123-
# We cannot assert the server was marked Unknown and pool was cleared an
124-
# exact number of times because the RTT hello may have triggered this
125-
# failpoint one or many times as well.
126-
# - name: assertEventCount
127-
# object: testRunner
128-
# arguments:
129-
# event: ServerMarkedUnknownEvent
130-
# count: 1
131-
# - name: assertEventCount
132-
# object: testRunner
133-
# arguments:
134-
# event: PoolClearedEvent
135-
# count: 1
122+
# Assert the server was marked Unknown and pool was cleared exactly once.
123+
- name: assertEventCount
124+
object: testRunner
125+
arguments:
126+
event: ServerMarkedUnknownEvent
127+
count: 1
128+
- name: assertEventCount
129+
object: testRunner
130+
arguments:
131+
event: PoolClearedEvent
132+
count: 1
136133

137134
expectations:
138135
- command_started_event:

test/spec/server-discovery-and-monitoring/integration/hello-network-error.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@
116116
"failPoint": {
117117
"configureFailPoint": "failCommand",
118118
"mode": {
119-
"times": 4
119+
"times": 2
120120
},
121121
"data": {
122122
"failCommands": [

test/spec/server-discovery-and-monitoring/integration/hello-network-error.yml

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -84,15 +84,14 @@ tests:
8484
- _id: 1
8585
- _id: 2
8686
# Configure the next streaming hello check to fail with a non-timeout
87-
# network error. Use "times: 4" to increase the probability that the
88-
# Monitor check fails since the RTT hello may trigger this failpoint one
89-
# or many times as well.
87+
# network error. Use times: 2 to ensure that the the Monitor check fails
88+
# since the RTT hello may trigger this failpoint as well.
9089
- name: configureFailPoint
9190
object: testRunner
9291
arguments:
9392
failPoint:
9493
configureFailPoint: failCommand
95-
mode: { times: 4 }
94+
mode: { times: 2 }
9695
data:
9796
failCommands: ["hello", "isMaster"]
9897
appName: networkErrorCheckTest
@@ -117,8 +116,8 @@ tests:
117116
- _id: 3
118117
- _id: 4
119118
# We cannot assert the server was marked Unknown and pool was cleared an
120-
# exact number of times because the RTT hello may have triggered this
121-
# failpoint one or many times as well.
119+
# exact number of times because the RTT hello may or may not have
120+
# triggered this failpoint as well.
122121
# - name: assertEventCount
123122
# object: testRunner
124123
# arguments:

test/spec/server-discovery-and-monitoring/integration/hello-timeout.json

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@
117117
"failPoint": {
118118
"configureFailPoint": "failCommand",
119119
"mode": {
120-
"times": 4
120+
"times": 2
121121
},
122122
"data": {
123123
"failCommands": [
@@ -160,6 +160,22 @@
160160
}
161161
]
162162
}
163+
},
164+
{
165+
"name": "assertEventCount",
166+
"object": "testRunner",
167+
"arguments": {
168+
"event": "ServerMarkedUnknownEvent",
169+
"count": 1
170+
}
171+
},
172+
{
173+
"name": "assertEventCount",
174+
"object": "testRunner",
175+
"arguments": {
176+
"event": "PoolClearedEvent",
177+
"count": 1
178+
}
163179
}
164180
],
165181
"expectations": [

test/spec/server-discovery-and-monitoring/integration/hello-timeout.yml

Lines changed: 14 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -84,16 +84,14 @@ tests:
8484
documents:
8585
- _id: 1
8686
- _id: 2
87-
# Configure the next streaming hello check to fail with a timeout.
88-
# Use "times: 4" to increase the probability that the Monitor check times
89-
# out since the RTT hello may trigger this failpoint one or many times as
90-
# well.
87+
# Configure the next streaming hello check to fail with a timeout
88+
# Use times: 2 so that the RTT hello is blocked as well.
9189
- name: configureFailPoint
9290
object: testRunner
9391
arguments:
9492
failPoint:
9593
configureFailPoint: failCommand
96-
mode: { times: 4 }
94+
mode: { times: 2 }
9795
data:
9896
failCommands: ["hello", "isMaster"]
9997
appName: timeoutMonitorCheckTest
@@ -121,19 +119,17 @@ tests:
121119
documents:
122120
- _id: 3
123121
- _id: 4
124-
# We cannot assert the server was marked Unknown and pool was cleared an
125-
# exact number of times because the RTT hello may have triggered this
126-
# failpoint one or many times as well.
127-
# - name: assertEventCount
128-
# object: testRunner
129-
# arguments:
130-
# event: ServerMarkedUnknownEvent
131-
# count: 1
132-
# - name: assertEventCount
133-
# object: testRunner
134-
# arguments:
135-
# event: PoolClearedEvent
136-
# count: 1
122+
# Assert the server was marked Unknown and pool was cleared exactly once.
123+
- name: assertEventCount
124+
object: testRunner
125+
arguments:
126+
event: ServerMarkedUnknownEvent
127+
count: 1
128+
- name: assertEventCount
129+
object: testRunner
130+
arguments:
131+
event: PoolClearedEvent
132+
count: 1
137133

138134
expectations:
139135
- command_started_event:

0 commit comments

Comments
 (0)