summaryrefslogtreecommitdiff
path: root/jstests/noPassthrough/timestamp_index_builds.js
diff options
context:
space:
mode:
Diffstat (limited to 'jstests/noPassthrough/timestamp_index_builds.js')
-rw-r--r--jstests/noPassthrough/timestamp_index_builds.js3
1 files changed, 2 insertions, 1 deletions
diff --git a/jstests/noPassthrough/timestamp_index_builds.js b/jstests/noPassthrough/timestamp_index_builds.js
index 89f7214b6de..6421c2cbaa5 100644
--- a/jstests/noPassthrough/timestamp_index_builds.js
+++ b/jstests/noPassthrough/timestamp_index_builds.js
@@ -32,7 +32,7 @@ const rst = new ReplSetTest({
nodeOptions: {setParameter: {logComponentVerbosity: tojsononeline({storage: {recovery: 2}})}}
});
const nodes = rst.startSet();
-rst.initiate();
+rst.initiateWithHighElectionTimeout();
if (!rst.getPrimary().adminCommand("serverStatus").storageEngine.supportsSnapshotReadConcern) {
// Only snapshotting storage engines require correct timestamping of index builds.
@@ -84,6 +84,7 @@ for (let nodeIdx = 0; nodeIdx < 2; ++nodeIdx) {
{
jsTestLog("Starting as a replica set. Both indexes should exist. Node: " + nodeIdentity);
let conn = rst.start(nodeIdx, {startClean: false}, true);
+ rst.waitForState(conn, ReplSetTest.State.SECONDARY);
conn.setSlaveOk();
IndexBuildTest.assertIndexes(getColl(conn), 2, ['_id_', 'foo_1']);
rst.stop(nodeIdx);