summaryrefslogtreecommitdiff
path: root/jstests/noPassthroughWithMongod/indexbg_drop.js
diff options
context:
space:
mode:
Diffstat (limited to 'jstests/noPassthroughWithMongod/indexbg_drop.js')
-rw-r--r--jstests/noPassthroughWithMongod/indexbg_drop.js8
1 files changed, 8 insertions, 0 deletions
diff --git a/jstests/noPassthroughWithMongod/indexbg_drop.js b/jstests/noPassthroughWithMongod/indexbg_drop.js
index df346f13c9b..d7cbb4a781b 100644
--- a/jstests/noPassthroughWithMongod/indexbg_drop.js
+++ b/jstests/noPassthroughWithMongod/indexbg_drop.js
@@ -56,6 +56,14 @@ jsTest.log("Starting background indexing for test of: " + tojson(dc));
masterDB.getCollection(collection).ensureIndex({b: 1});
masterDB.getCollection(collection).ensureIndex({i: 1}, {background: true});
+assert.eq(3, masterDB.getCollection(collection).getIndexes().length);
+
+// Wait for the secondary to get the index entry
+assert.soon(function() {
+ return 3 == secondDB.getCollection(collection).getIndexes().length;
+}, "index not created on secondary (prior to drop)", 240000);
+
+jsTest.log("Index created and index entry exists on secondary");
// make sure the index build has started on secondary
assert.soon(function() {