summaryrefslogtreecommitdiff
path: root/jstests/replsets/restore_term.js
diff options
context:
space:
mode:
authorKaloian Manassiev <kaloian.manassiev@mongodb.com>2015-11-25 11:20:43 -0500
committerKaloian Manassiev <kaloian.manassiev@mongodb.com>2015-12-08 13:05:00 -0500
commit3ed6635a5fb26c354046d275a1217c4526b2fe02 (patch)
treef40aa20b5e62996843ce3df0f47b82042dd683a7 /jstests/replsets/restore_term.js
parent4f24dc58f48cb087db8a4832421d298e9e2633a0 (diff)
downloadmongo-3ed6635a5fb26c354046d275a1217c4526b2fe02.tar.gz
SERVER-21050 Cleanup ReplSetTest
This is just a cleanup work to hide some of the private state of ReplSetTest so it is easier to encapsulate and add new logic. Also enables strict mode.
Diffstat (limited to 'jstests/replsets/restore_term.js')
-rw-r--r--jstests/replsets/restore_term.js6
1 files changed, 3 insertions, 3 deletions
diff --git a/jstests/replsets/restore_term.js b/jstests/replsets/restore_term.js
index 00fa68ed0d0..0a0af27c08f 100644
--- a/jstests/replsets/restore_term.js
+++ b/jstests/replsets/restore_term.js
@@ -30,7 +30,7 @@ conf.protocolVersion = 1;
rst.initiate(conf);
rst.awaitSecondaryNodes();
-var primary = rst.getMaster();
+var primary = rst.getPrimary();
var primaryColl = primary.getDB("test").coll;
// Current term may be greater than 1 if election race happens.
@@ -53,13 +53,13 @@ try {
rst.awaitSecondaryNodes();
// The secondary became the new primary now with a higher term.
// Since there's only one secondary who may run for election, the new term is higher by 1.
-assert.eq(getCurrentTerm(rst.getMaster()), firstSuccessfulTerm + 1);
+assert.eq(getCurrentTerm(rst.getPrimary()), firstSuccessfulTerm + 1);
// Restart the replset and verify the term is the same.
rst.stopSet(null /* signal */, true /* forRestart */);
rst.startSet({restart: true});
rst.awaitSecondaryNodes();
-primary = rst.getMaster();
+primary = rst.getPrimary();
assert.eq(primary.getDB("test").coll.find().itcount(), 1);
// After restart, the new primary stands up with the newer term.