diff options
-rw-r--r-- | jstests/noPassthrough/libs/index_initial_sync.js | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/jstests/noPassthrough/libs/index_initial_sync.js b/jstests/noPassthrough/libs/index_initial_sync.js index 9ec16580798..ecd2322d6d9 100644 --- a/jstests/noPassthrough/libs/index_initial_sync.js +++ b/jstests/noPassthrough/libs/index_initial_sync.js @@ -45,8 +45,9 @@ var IndexInitialSyncTest = function(options) { startClean: true, }); - // Wait for the secondary to complete initial sync. + // Wait for the secondary to complete initial sync and transition to SECONDARY state. rst.awaitReplication(); + rst.awaitSecondaryNodes(); // Ensure that the index on the secondary is in an unfinished state. const secondaryDB = secondary.getDB(testDB.getName()); |