diff options
Diffstat (limited to 'src/mongo/db/repl/replication_coordinator_impl_heartbeat_test.cpp')
-rw-r--r-- | src/mongo/db/repl/replication_coordinator_impl_heartbeat_test.cpp | 41 |
1 files changed, 18 insertions, 23 deletions
diff --git a/src/mongo/db/repl/replication_coordinator_impl_heartbeat_test.cpp b/src/mongo/db/repl/replication_coordinator_impl_heartbeat_test.cpp index 0c630f772a5..fa9843b15ad 100644 --- a/src/mongo/db/repl/replication_coordinator_impl_heartbeat_test.cpp +++ b/src/mongo/db/repl/replication_coordinator_impl_heartbeat_test.cpp @@ -53,17 +53,12 @@ using executor::RemoteCommandResponse; class ReplCoordHBTest : public ReplCoordTest { protected: - void assertStartSuccess(const BSONObj& configDoc, const HostAndPort& selfHost); void assertMemberState(MemberState expected, std::string msg = ""); ReplSetHeartbeatResponse receiveHeartbeatFrom(const ReplicaSetConfig& rsConfig, int sourceId, const HostAndPort& source); }; -void ReplCoordHBTest::assertStartSuccess(const BSONObj& configDoc, const HostAndPort& selfHost) { - ReplCoordTest::assertStartSuccess(addProtocolVersion(configDoc, 0), selfHost); -} - void ReplCoordHBTest::assertMemberState(const MemberState expected, std::string msg) { const MemberState actual = getReplCoord()->getMemberState(); ASSERT(expected == actual) << "Expected coordinator to report state " << expected.toString() @@ -88,15 +83,15 @@ ReplSetHeartbeatResponse ReplCoordHBTest::receiveHeartbeatFrom(const ReplicaSetC TEST_F(ReplCoordHBTest, JoinExistingReplSet) { logger::globalLogDomain()->setMinimumLoggedSeverity(logger::LogSeverity::Debug(3)); - ReplicaSetConfig rsConfig = assertMakeRSConfigV0(BSON("_id" - << "mySet" - << "version" << 3 << "members" - << BSON_ARRAY(BSON("_id" << 1 << "host" - << "h1:1") - << BSON("_id" << 2 << "host" - << "h2:1") - << BSON("_id" << 3 << "host" - << "h3:1")))); + ReplicaSetConfig rsConfig = + assertMakeRSConfig(BSON("_id" + << "mySet" + << "version" << 3 << "members" + << BSON_ARRAY(BSON("_id" << 1 << "host" + << "h1:1") + << BSON("_id" << 2 << "host" + << "h2:1") << BSON("_id" << 3 << "host" + << "h3:1")))); init("mySet"); addSelf(HostAndPort("h2", 1)); const Date_t startDate = getNet()->now(); @@ -151,15 +146,15 @@ TEST_F(ReplCoordHBTest, DoNotJoinReplSetIfNotAMember) { // Tests that a node in RS_STARTUP will not transition to RS_REMOVED if it receives a // configuration that does not contain it. logger::globalLogDomain()->setMinimumLoggedSeverity(logger::LogSeverity::Debug(3)); - ReplicaSetConfig rsConfig = assertMakeRSConfigV0(BSON("_id" - << "mySet" - << "version" << 3 << "members" - << BSON_ARRAY(BSON("_id" << 1 << "host" - << "h1:1") - << BSON("_id" << 2 << "host" - << "h2:1") - << BSON("_id" << 3 << "host" - << "h3:1")))); + ReplicaSetConfig rsConfig = + assertMakeRSConfig(BSON("_id" + << "mySet" + << "version" << 3 << "members" + << BSON_ARRAY(BSON("_id" << 1 << "host" + << "h1:1") + << BSON("_id" << 2 << "host" + << "h2:1") << BSON("_id" << 3 << "host" + << "h3:1")))); init("mySet"); addSelf(HostAndPort("h4", 1)); const Date_t startDate = getNet()->now(); |