Skip to content

Commit

Permalink
DRIVERS-2386 Improve reliability of SDAM heartbeat error spec tests. (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
matthewdale committed Jul 13, 2022
1 parent 5cf3ed7 commit 98e20da
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 79 deletions.
Expand Up @@ -117,7 +117,7 @@
"failPoint": {
"configureFailPoint": "failCommand",
"mode": {
"times": 2
"times": 4
},
"data": {
"failCommands": [
Expand Down Expand Up @@ -162,22 +162,6 @@
}
]
}
},
{
"name": "assertEventCount",
"object": "testRunner",
"arguments": {
"event": "ServerMarkedUnknownEvent",
"count": 1
}
},
{
"name": "assertEventCount",
"object": "testRunner",
"arguments": {
"event": "PoolClearedEvent",
"count": 1
}
}
],
"expectations": [
Expand Down
Expand Up @@ -84,15 +84,16 @@ tests:
documents:
- _id: 1
- _id: 2
# Configure the next streaming hello check to fail with a command
# error.
# Use times: 2 so that the RTT hello is blocked as well.
# Configure the next streaming hello check to fail with a command error.
# Use "times: 4" to increase the probability that the Monitor check fails
# since the RTT hello may trigger this failpoint one or many times as
# well.
- name: configureFailPoint
object: testRunner
arguments:
failPoint:
configureFailPoint: failCommand
mode: { times: 2 }
mode: { times: 4 }
data:
failCommands: ["hello", "isMaster"]
appName: commandErrorCheckTest
Expand All @@ -119,17 +120,9 @@ tests:
documents:
- _id: 3
- _id: 4
# Assert the server was marked Unknown and pool was cleared exactly once.
- name: assertEventCount
object: testRunner
arguments:
event: ServerMarkedUnknownEvent
count: 1
- name: assertEventCount
object: testRunner
arguments:
event: PoolClearedEvent
count: 1
# We cannot assert the server was marked Unknown and pool was cleared an
# exact number of times because the RTT hello may have triggered this
# failpoint one or many times as well.

expectations:
- command_started_event:
Expand Down
Expand Up @@ -116,7 +116,7 @@
"failPoint": {
"configureFailPoint": "failCommand",
"mode": {
"times": 2
"times": 4
},
"data": {
"failCommands": [
Expand Down
Expand Up @@ -42,16 +42,6 @@ tests:
# We cannot assert the server was marked Unknown and pool was cleared an
# exact number of times because the RTT hello may or may not have
# triggered this failpoint as well.
# - name: assertEventCount
# object: testRunner
# arguments:
# event: ServerMarkedUnknownEvent
# count: 1
# - name: assertEventCount
# object: testRunner
# arguments:
# event: PoolClearedEvent
# count: 1

expectations:
- command_started_event:
Expand Down Expand Up @@ -84,14 +74,15 @@ tests:
- _id: 1
- _id: 2
# Configure the next streaming hello check to fail with a non-timeout
# network error. Use times: 2 to ensure that the the Monitor check fails
# since the RTT hello may trigger this failpoint as well.
# network error. Use "times: 4" to increase the probability that the
# Monitor check fails since the RTT hello may trigger this failpoint one
# or many times as well.
- name: configureFailPoint
object: testRunner
arguments:
failPoint:
configureFailPoint: failCommand
mode: { times: 2 }
mode: { times: 4 }
data:
failCommands: ["hello", "isMaster"]
appName: networkErrorCheckTest
Expand All @@ -116,8 +107,8 @@ tests:
- _id: 3
- _id: 4
# We cannot assert the server was marked Unknown and pool was cleared an
# exact number of times because the RTT hello may or may not have
# triggered this failpoint as well.
# exact number of times because the RTT hello may have triggered this
# failpoint one or many times as well.
# - name: assertEventCount
# object: testRunner
# arguments:
Expand Down
Expand Up @@ -117,7 +117,7 @@
"failPoint": {
"configureFailPoint": "failCommand",
"mode": {
"times": 2
"times": 4
},
"data": {
"failCommands": [
Expand Down Expand Up @@ -160,22 +160,6 @@
}
]
}
},
{
"name": "assertEventCount",
"object": "testRunner",
"arguments": {
"event": "ServerMarkedUnknownEvent",
"count": 1
}
},
{
"name": "assertEventCount",
"object": "testRunner",
"arguments": {
"event": "PoolClearedEvent",
"count": 1
}
}
],
"expectations": [
Expand Down
Expand Up @@ -84,14 +84,16 @@ tests:
documents:
- _id: 1
- _id: 2
# Configure the next streaming hello check to fail with a timeout
# Use times: 2 so that the RTT hello is blocked as well.
# Configure the next streaming hello check to fail with a timeout.
# Use "times: 4" to increase the probability that the Monitor check times
# out since the RTT hello may trigger this failpoint one or many times as
# well.
- name: configureFailPoint
object: testRunner
arguments:
failPoint:
configureFailPoint: failCommand
mode: { times: 2 }
mode: { times: 4 }
data:
failCommands: ["hello", "isMaster"]
appName: timeoutMonitorCheckTest
Expand Down Expand Up @@ -119,17 +121,9 @@ tests:
documents:
- _id: 3
- _id: 4
# Assert the server was marked Unknown and pool was cleared exactly once.
- name: assertEventCount
object: testRunner
arguments:
event: ServerMarkedUnknownEvent
count: 1
- name: assertEventCount
object: testRunner
arguments:
event: PoolClearedEvent
count: 1
# We cannot assert the server was marked Unknown and pool was cleared an
# exact number of times because the RTT hello may have triggered this
# failpoint one or many times as well.

expectations:
- command_started_event:
Expand Down

0 comments on commit 98e20da

Please sign in to comment.