summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJason Chan <jason.chan@10gen.com>2020-04-24 15:52:03 -0400
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2020-05-01 21:12:56 +0000
commit4d8bc5a24d08a7db945a000d569557fc1f04d539 (patch)
treebf085d60ee19f5c15e44e0c1f0443154058249c3 /src
parent4ddd61ae55adf829bece623c9cf923e7151d734a (diff)
downloadmongo-4d8bc5a24d08a7db945a000d569557fc1f04d539.tar.gz
SERVER-47763 Only run exhaust ismaster metrics tests in the integration_tests_standalone and integration_tests_sharded suites
Diffstat (limited to 'src')
-rw-r--r--src/mongo/rpc/op_msg_integration_test.cpp39
1 files changed, 18 insertions, 21 deletions
diff --git a/src/mongo/rpc/op_msg_integration_test.cpp b/src/mongo/rpc/op_msg_integration_test.cpp
index 2222d3b6a1d..1c6400e2cba 100644
--- a/src/mongo/rpc/op_msg_integration_test.cpp
+++ b/src/mongo/rpc/op_msg_integration_test.cpp
@@ -711,15 +711,14 @@ TEST(OpMsg, ServerRejectsExhaustIsMasterWithoutMaxAwaitTimeMS) {
TEST(OpMsg, ServerStatusCorrectlyShowsExhaustIsMasterMetrics) {
std::string errMsg;
- auto fixtureConn = std::unique_ptr<DBClientBase>(
+ auto conn = std::unique_ptr<DBClientBase>(
unittest::getFixtureConnectionString().connect("integration_test", errMsg));
- uassert(ErrorCodes::SocketException, errMsg, fixtureConn);
- DBClientBase* conn = fixtureConn.get();
+ uassert(ErrorCodes::SocketException, errMsg, conn);
- if (fixtureConn->isReplicaSetMember()) {
- // Connect directly to the primary.
- conn = &static_cast<DBClientReplicaSet*>(fixtureConn.get())->masterConn();
- ASSERT(conn);
+ if (conn->isReplicaSetMember()) {
+ // Don't run on replica sets as the RSM will use the streamable isMaster protocol by
+ // default. This can cause inconsistencies in our metrics tests.
+ return;
}
// Wait for stale exhuast streams to finish closing before testing the exhaust isMaster metrics.
@@ -771,15 +770,14 @@ TEST(OpMsg, ServerStatusCorrectlyShowsExhaustIsMasterMetrics) {
TEST(OpMsg, ExhaustIsMasterMetricDecrementsOnNewOpAfterTerminatingExhaustStream) {
std::string errMsg;
const auto conn1AppName = "integration_test";
- auto fixtureConn = std::unique_ptr<DBClientBase>(
+ auto conn1 = std::unique_ptr<DBClientBase>(
unittest::getFixtureConnectionString().connect(conn1AppName, errMsg));
- uassert(ErrorCodes::SocketException, errMsg, fixtureConn);
- DBClientBase* conn1 = fixtureConn.get();
+ uassert(ErrorCodes::SocketException, errMsg, conn1);
- if (fixtureConn->isReplicaSetMember()) {
- // Connect directly to the primary.
- conn1 = &static_cast<DBClientReplicaSet*>(fixtureConn.get())->masterConn();
- ASSERT(conn1);
+ if (conn1->isReplicaSetMember()) {
+ // Don't run on replica sets as the RSM will use the streamable isMaster protocol by
+ // default. This can cause inconsistencies in our metrics tests.
+ return;
}
// Wait for stale exhuast streams to finish closing before testing the exhaust isMaster metrics.
@@ -862,15 +860,14 @@ TEST(OpMsg, ExhaustIsMasterMetricDecrementsOnNewOpAfterTerminatingExhaustStream)
TEST(OpMsg, ExhaustIsMasterMetricOnNewExhaustIsMasterAfterTerminatingExhaustStream) {
std::string errMsg;
const auto conn1AppName = "integration_test";
- auto fixtureConn = std::unique_ptr<DBClientBase>(
+ auto conn1 = std::unique_ptr<DBClientBase>(
unittest::getFixtureConnectionString().connect(conn1AppName, errMsg));
- uassert(ErrorCodes::SocketException, errMsg, fixtureConn);
- DBClientBase* conn1 = fixtureConn.get();
+ uassert(ErrorCodes::SocketException, errMsg, conn1);
- if (fixtureConn->isReplicaSetMember()) {
- // Connect directly to the primary.
- conn1 = &static_cast<DBClientReplicaSet*>(fixtureConn.get())->masterConn();
- ASSERT(conn1);
+ if (conn1->isReplicaSetMember()) {
+ // Don't run on replica sets as the RSM will use the streamable isMaster protocol by
+ // default. This can cause inconsistencies in our metrics tests.
+ return;
}
// Wait for stale exhuast streams to finish closing before testing the exhaust isMaster metrics.