diff options
author | Matthew Russotto <matthew.russotto@10gen.com> | 2017-12-01 12:04:04 -0500 |
---|---|---|
committer | Matthew Russotto <matthew.russotto@10gen.com> | 2018-01-03 12:03:10 -0500 |
commit | a6a3056ce0833e969665380e0eca7ed2aca42742 (patch) | |
tree | bd28e4b3b9203031649380bb34ba39dd45180583 | |
parent | be7e525b14dddf56fbec90190da60dc020abb0f9 (diff) | |
download | mongo-a6a3056ce0833e969665380e0eca7ed2aca42742.tar.gz |
SERVER-32136 initial_sync_drop_collection.js should wait for system to stabilize after restarting node.
(cherry picked from commit 5be8810c5df9c98966cee6539220ebc7b38bf4c8)
-rw-r--r-- | jstests/replsets/initial_sync_drop_collection.js | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/jstests/replsets/initial_sync_drop_collection.js b/jstests/replsets/initial_sync_drop_collection.js index b4954817afe..bab5e8011c1 100644 --- a/jstests/replsets/initial_sync_drop_collection.js +++ b/jstests/replsets/initial_sync_drop_collection.js @@ -10,7 +10,7 @@ // Set up replica set. const testName = "initial_sync_drop_collection"; const dbName = testName; - var replTest = new ReplSetTest({name: testName, nodes: 2}); + var replTest = new ReplSetTest({name: testName, nodes: [{}, {rsConfig: {priority: 0}}]}); replTest.startSet(); replTest.initiate(); @@ -41,6 +41,10 @@ jsTestLog("Waiting for secondary to reach failPoint " + failPoint); checkLog.contains(secondary, failPoint + " fail point enabled for " + nss); + + // Restarting the secondary may have resulted in an election. Wait until the system + // stabilizes. + replTest.getPrimary(); } function finishTest({failPoint, secondaryStartupParams, expectedLog, waitForDrop, createNew}) { @@ -118,7 +122,7 @@ // Add another node to the set, so when we drop the collection it can commit. This other // secondary will be finished with initial sync when the drop happens. - var secondary2 = replTest.add({}); + var secondary2 = replTest.add({rsConfig: {priority: 0}}); replTest.reInitiate(); replTest.waitForState(secondary2, ReplSetTest.State.SECONDARY); |