summaryrefslogtreecommitdiff
path: root/jstests/replsets/stepup.js
diff options
context:
space:
mode:
authorSiyuan Zhou <siyuan.zhou@mongodb.com>2016-07-06 18:55:54 -0400
committerSiyuan Zhou <siyuan.zhou@mongodb.com>2016-07-07 12:01:18 -0400
commit130485fbfa76a7134cf674cb06875b9eb74f397d (patch)
tree74bbf054b5b7176aa8f89c2882e57287d872b4f2 /jstests/replsets/stepup.js
parent3ceb166dca4e005ccc2c14e26913e5e267f7f808 (diff)
downloadmongo-130485fbfa76a7134cf674cb06875b9eb74f397d.tar.gz
SERVER-24881 Wait for the secondary to be able to win election in tests.
Diffstat (limited to 'jstests/replsets/stepup.js')
-rw-r--r--jstests/replsets/stepup.js3
1 files changed, 2 insertions, 1 deletions
diff --git a/jstests/replsets/stepup.js b/jstests/replsets/stepup.js
index 1591060562e..c074649b5dc 100644
--- a/jstests/replsets/stepup.js
+++ b/jstests/replsets/stepup.js
@@ -44,8 +44,9 @@ load("jstests/replsets/rslib.js");
assert.commandWorked(
secondary.getDB('admin').runCommand({configureFailPoint: 'rsSyncApplyStop', mode: 'off'}));
+ // Wait for the secondary to catch up.
+ assert.writeOK(primary.getDB("test").bar.insert({x: 3}, {writeConcern: {w: 2, j: true}}));
// Step up the secondary and succeed.
- rst.awaitReplication();
res = secondary.adminCommand({replSetStepUp: 1});
assert.commandWorked(res);
assert.eq(secondary, rst.getPrimary());