0
0
mirror of https://github.com/mongodb/mongo.git synced 2024-12-01 09:32:32 +01:00

SERVER-24881 Wait for the secondary to be able to win election in tests.

This commit is contained in:
Siyuan Zhou 2016-07-06 18:55:54 -04:00
parent 3ceb166dca
commit 130485fbfa

View File

@ -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());