diff options
author | Judah Schvimer <judah@mongodb.com> | 2017-09-26 13:54:59 -0400 |
---|---|---|
committer | Judah Schvimer <judah@mongodb.com> | 2017-09-26 13:54:59 -0400 |
commit | e90f530a1f03490743bb66481e0011c72adaab53 (patch) | |
tree | 5f6bb8655a3066868d71205f51034230287ee049 /src/mongo/db/repl/replication_coordinator_impl_heartbeat_v1_test.cpp | |
parent | 726e5544108d7ef417de351d103f52c028feae3b (diff) | |
download | mongo-e90f530a1f03490743bb66481e0011c72adaab53.tar.gz |
SERVER-28794 Only use PV0 style heartbeats when choosing to use PV0
Diffstat (limited to 'src/mongo/db/repl/replication_coordinator_impl_heartbeat_v1_test.cpp')
-rw-r--r-- | src/mongo/db/repl/replication_coordinator_impl_heartbeat_v1_test.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/mongo/db/repl/replication_coordinator_impl_heartbeat_v1_test.cpp b/src/mongo/db/repl/replication_coordinator_impl_heartbeat_v1_test.cpp index d8d040c8c26..6e77d46c084 100644 --- a/src/mongo/db/repl/replication_coordinator_impl_heartbeat_v1_test.cpp +++ b/src/mongo/db/repl/replication_coordinator_impl_heartbeat_v1_test.cpp @@ -114,10 +114,11 @@ TEST_F(ReplCoordHBV1Test, NetworkInterfaceMock::NetworkOperationIterator noi = net->getNextReadyRequest(); const RemoteCommandRequest& request = noi->getRequest(); ASSERT_EQUALS(HostAndPort("h1", 1), request.target); - ReplSetHeartbeatArgs hbArgs; + ReplSetHeartbeatArgsV1 hbArgs; ASSERT_OK(hbArgs.initialize(request.cmdObj)); ASSERT_EQUALS("mySet", hbArgs.getSetName()); ASSERT_EQUALS(-2, hbArgs.getConfigVersion()); + ASSERT_EQUALS(OpTime::kInitialTerm, hbArgs.getTerm()); ReplSetHeartbeatResponse hbResp; hbResp.setSetName("mySet"); hbResp.setState(MemberState::RS_PRIMARY); @@ -183,10 +184,11 @@ TEST_F(ReplCoordHBV1Test, NetworkInterfaceMock::NetworkOperationIterator noi = net->getNextReadyRequest(); const RemoteCommandRequest& request = noi->getRequest(); ASSERT_EQUALS(HostAndPort("h1", 1), request.target); - ReplSetHeartbeatArgs hbArgs; + ReplSetHeartbeatArgsV1 hbArgs; ASSERT_OK(hbArgs.initialize(request.cmdObj)); ASSERT_EQUALS("mySet", hbArgs.getSetName()); ASSERT_EQUALS(-2, hbArgs.getConfigVersion()); + ASSERT_EQUALS(OpTime::kInitialTerm, hbArgs.getTerm()); ReplSetHeartbeatResponse hbResp; hbResp.setSetName("mySet"); hbResp.setState(MemberState::RS_PRIMARY); @@ -252,10 +254,11 @@ TEST_F(ReplCoordHBV1Test, NetworkInterfaceMock::NetworkOperationIterator noi = net->getNextReadyRequest(); const RemoteCommandRequest& request = noi->getRequest(); ASSERT_EQUALS(HostAndPort("h1", 1), request.target); - ReplSetHeartbeatArgs hbArgs; + ReplSetHeartbeatArgsV1 hbArgs; ASSERT_OK(hbArgs.initialize(request.cmdObj)); ASSERT_EQUALS("mySet", hbArgs.getSetName()); ASSERT_EQUALS(-2, hbArgs.getConfigVersion()); + ASSERT_EQUALS(OpTime::kInitialTerm, hbArgs.getTerm()); ReplSetHeartbeatResponse hbResp; hbResp.setSetName("mySet"); hbResp.setState(MemberState::RS_PRIMARY); |