diff options
author | Samy Lanka <samy.lanka@10gen.com> | 2017-06-19 15:43:11 -0400 |
---|---|---|
committer | Samy Lanka <samy.lanka@10gen.com> | 2017-06-30 16:23:39 -0400 |
commit | 453028f378f8344197cea0e3ded53f445ccd5abf (patch) | |
tree | 8aca7d4ab9c7f34f135cc3659a6c828336f214fc /src/mongo/db/repl/repl_set_config_test.cpp | |
parent | c63465a42ed89ee6563841d7b349fa85de69963e (diff) | |
download | mongo-453028f378f8344197cea0e3ded53f445ccd5abf.tar.gz |
SERVER-29499 Schedule a catchup takeover on receiving heartbeats from the current primary
Diffstat (limited to 'src/mongo/db/repl/repl_set_config_test.cpp')
-rw-r--r-- | src/mongo/db/repl/repl_set_config_test.cpp | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/src/mongo/db/repl/repl_set_config_test.cpp b/src/mongo/db/repl/repl_set_config_test.cpp index 8f582195b51..f9d0ec01f9d 100644 --- a/src/mongo/db/repl/repl_set_config_test.cpp +++ b/src/mongo/db/repl/repl_set_config_test.cpp @@ -1632,6 +1632,31 @@ TEST(ReplSetConfig, GetPriorityTakeoverDelay) { ASSERT_EQUALS(Milliseconds(1000), configB.getPriorityTakeoverDelay(4)); } +TEST(ReplSetConfig, GetCatchupTakeoverDelay) { + ReplSetConfig configA; + ASSERT_OK(configA.initialize(BSON("_id" + << "rs0" + << "version" + << 1 + << "members" + << BSON_ARRAY(BSON("_id" << 0 << "host" + << "localhost:12345" + << "priority" + << 1) + << BSON("_id" << 1 << "host" + << "localhost:54321" + << "priority" + << 2) + << BSON("_id" << 2 << "host" + << "localhost:5321" + << "priority" + << 3)) + << "settings" + << BSON("electionTimeoutMillis" << 1000)))); + ASSERT_OK(configA.validate()); + ASSERT_EQUALS(Milliseconds(30000), configA.getCatchupTakeoverDelay()); +} + TEST(ReplSetConfig, ConfirmDefaultValuesOfAndAbilityToSetWriteConcernMajorityJournalDefault) { // PV0, should default to false. ReplSetConfig config; |