summaryrefslogtreecommitdiff
path: root/src/mongo
diff options
context:
space:
mode:
authorHuayu Ouyang <huayu.ouyang@mongodb.com>2020-09-28 21:21:30 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2020-09-29 16:43:07 +0000
commit5ecee573374e0131e3c3454392b2c51694a7f175 (patch)
treefe6b99285d4b5bae483b4c3e4e26caceeb2017b3 /src/mongo
parent1042e3d11c01daffc385a3c9b9af66eb98bf6162 (diff)
downloadmongo-5ecee573374e0131e3c3454392b2c51694a7f175.tar.gz
SERVER-50418 wait for all exhaust streams to close before starting tests
Diffstat (limited to 'src/mongo')
-rw-r--r--src/mongo/rpc/op_msg_integration_test.cpp36
1 files changed, 12 insertions, 24 deletions
diff --git a/src/mongo/rpc/op_msg_integration_test.cpp b/src/mongo/rpc/op_msg_integration_test.cpp
index 15cb888462c..ec7aa12a2bc 100644
--- a/src/mongo/rpc/op_msg_integration_test.cpp
+++ b/src/mongo/rpc/op_msg_integration_test.cpp
@@ -722,16 +722,13 @@ void serverStatusCorrectlyShowsExhaustMetrics(std::string commandName) {
}
bool useLegacyCommandName = (commandName != "hello");
- // Wait for stale exhuast streams to finish closing before testing the exhaust hello or metrics.
+ // Wait for stale exhaust streams to finish closing before testing the exhaust metrics.
ASSERT(waitForCondition([&] {
auto serverStatusCmd = BSON("serverStatus" << 1);
BSONObj serverStatusReply;
ASSERT(conn->runCommand("admin", serverStatusCmd, serverStatusReply));
- if (useLegacyCommandName) {
- return serverStatusReply["connections"]["exhaustIsMaster"].numberInt() == 0;
- } else {
- return serverStatusReply["connections"]["exhaustHello"].numberInt() == 0;
- }
+ return serverStatusReply["connections"]["exhaustIsMaster"].numberInt() == 0 &&
+ serverStatusReply["connections"]["exhaustHello"].numberInt() == 0;
}));
// Issue a hello or isMaster command without a topology version.
@@ -801,16 +798,13 @@ void exhaustMetricSwitchingCommandNames(bool useLegacyCommandNameAtStart) {
return;
}
- // Wait for stale exhuast streams to finish closing before testing the exhaust metrics.
+ // Wait for stale exhaust streams to finish closing before testing the exhaust metrics.
ASSERT(waitForCondition([&] {
auto serverStatusCmd = BSON("serverStatus" << 1);
BSONObj serverStatusReply;
ASSERT(conn1->runCommand("admin", serverStatusCmd, serverStatusReply));
- if (useLegacyCommandNameAtStart) {
- return serverStatusReply["connections"]["exhaustIsMaster"].numberInt() == 0;
- } else {
- return serverStatusReply["connections"]["exhaustHello"].numberInt() == 0;
- }
+ return serverStatusReply["connections"]["exhaustIsMaster"].numberInt() == 0 &&
+ serverStatusReply["connections"]["exhaustHello"].numberInt() == 0;
}));
// Issue a hello or isMaster command without a topology version.
@@ -943,16 +937,13 @@ void exhaustMetricDecrementsOnNewOpAfterTerminatingExhaustStream(bool useLegacyC
return;
}
- // Wait for stale exhuast streams to finish closing before testing the exhaust metrics.
+ // Wait for stale exhaust streams to finish closing before testing the exhaust metrics.
ASSERT(waitForCondition([&] {
auto serverStatusCmd = BSON("serverStatus" << 1);
BSONObj serverStatusReply;
ASSERT(conn1->runCommand("admin", serverStatusCmd, serverStatusReply));
- if (useLegacyCommandName) {
- return serverStatusReply["connections"]["exhaustIsMaster"].numberInt() == 0;
- } else {
- return serverStatusReply["connections"]["exhaustHello"].numberInt() == 0;
- }
+ return serverStatusReply["connections"]["exhaustIsMaster"].numberInt() == 0 &&
+ serverStatusReply["connections"]["exhaustHello"].numberInt() == 0;
}));
// Issue a hello or isMaster command without a topology version.
@@ -1061,16 +1052,13 @@ void exhaustMetricOnNewExhaustAfterTerminatingExhaustStream(bool useLegacyComman
return;
}
- // Wait for stale exhuast streams to finish closing before testing the exhaust metrics.
+ // Wait for stale exhaust streams to finish closing before testing the exhaust metrics.
ASSERT(waitForCondition([&] {
auto serverStatusCmd = BSON("serverStatus" << 1);
BSONObj serverStatusReply;
ASSERT(conn1->runCommand("admin", serverStatusCmd, serverStatusReply));
- if (useLegacyCommandName) {
- return serverStatusReply["connections"]["exhaustIsMaster"].numberInt() == 0;
- } else {
- return serverStatusReply["connections"]["exhaustHello"].numberInt() == 0;
- }
+ return serverStatusReply["connections"]["exhaustIsMaster"].numberInt() == 0 &&
+ serverStatusReply["connections"]["exhaustHello"].numberInt() == 0;
}));
// Issue a hello or isMaster command without a topology version.