summaryrefslogtreecommitdiff
path: root/jstests/replsets/drain.js
diff options
context:
space:
mode:
authorSiyuan Zhou <siyuan.zhou@mongodb.com>2017-01-30 18:52:40 -0500
committerSiyuan Zhou <siyuan.zhou@mongodb.com>2017-02-01 16:49:27 -0500
commit133dbba8f749d3ac758a5365d504341331b03468 (patch)
treeae43f29efe77c7e8ebbfe629f50d61edf704f6e4 /jstests/replsets/drain.js
parent29ee4e817e4d8131892a22b7de62d64e08034ca6 (diff)
downloadmongo-133dbba8f749d3ac758a5365d504341331b03468.tar.gz
SERVER-27861 Make the failover in drain.js more reliable
Diffstat (limited to 'jstests/replsets/drain.js')
-rw-r--r--jstests/replsets/drain.js8
1 files changed, 3 insertions, 5 deletions
diff --git a/jstests/replsets/drain.js b/jstests/replsets/drain.js
index 357a812ce69..1f60713a6a6 100644
--- a/jstests/replsets/drain.js
+++ b/jstests/replsets/drain.js
@@ -27,7 +27,6 @@
var primary = replSet.getPrimary();
var secondary = replSet.getSecondary();
- var isPV0 = replSet.getReplSetConfigFromNode().protocolVersion != 1;
// Do an initial insert to prevent the secondary from going into recovery
var numDocuments = 20;
@@ -54,13 +53,12 @@
jsTestLog('Number of operations buffered on secondary since stopping applier: ' +
bufferCountChange);
return bufferCountChange >= numDocuments - 1;
- }, 'secondary did not buffer operations for new inserts on primary', 30000, 1000);
+ }, 'secondary did not buffer operations for new inserts on primary', 300000, 1000);
// Kill primary; secondary will enter drain mode to catch up
primary.getDB("admin").shutdownServer({force: true});
- var electionTimeout = (isPV0 ? 60 : 20) * 1000; // Timeout in milliseconds
- replSet.waitForState(secondary, ReplSetTest.State.PRIMARY, electionTimeout);
+ replSet.waitForState(secondary, ReplSetTest.State.PRIMARY);
// Ensure new primary is not yet writable
jsTestLog('New primary should not be writable yet');
@@ -97,7 +95,7 @@
assert.commandWorked(
secondary.adminCommand({
replSetTest: 1,
- waitForDrainFinish: 5000,
+ waitForDrainFinish: 30000,
}),
'replSetTest waitForDrainFinish should work when draining is allowed to complete');