Skip to content

Commit

Permalink
SERVER-13620 Make indexbg_drop.js expose the bug.
Browse files Browse the repository at this point in the history
(cherry picked from commit d4b1e9e)
  • Loading branch information
amschwerin authored and milkie committed Apr 21, 2014
1 parent 15bd709 commit 9be380c
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions jstests/noPassthroughWithMongod/indexbg_drop.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,15 @@ for( i = 0; i < size; ++i ) {
}

jsTest.log("Starting background indexing for test of: " + tojson(dc));
// Add another index to be sure the drop command works.
masterDB.getCollection(collection).ensureIndex({b:1});

masterDB.getCollection(collection).ensureIndex( {i:1}, {background:true} );
assert.eq(2, masterDB.system.indexes.count( {ns:dbname + "." + collection}, {background:true} ) );
assert.eq(3, masterDB.system.indexes.count( {ns:dbname + "." + collection}, {background:true} ) );

// Wait for the secondary to get the index entry
assert.soon(
function() { return 2 == secondDB.system.indexes.count( {ns:dbname + "." + collection} ); },
function() { return 3 == secondDB.system.indexes.count( {ns:dbname + "." + collection} ); },
"index not created on secondary (prior to drop)", 120000, 50 );

jsTest.log("Index created and system.indexes entry exists on secondary");
Expand Down

0 comments on commit 9be380c

Please sign in to comment.