From 44ae815066cdee7127ddeff34d3a04d75378fd61 Mon Sep 17 00:00:00 2001 From: Spencer T Brody Date: Tue, 23 Feb 2016 18:17:42 -0500 Subject: SERVER-22823 Increase stability of authCommands.js (cherry picked from commit fb015882a981d69567946661df87cb7398ae12f1) --- jstests/sharding/authCommands.js | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/jstests/sharding/authCommands.js b/jstests/sharding/authCommands.js index e97a319d9f1..2349c4a7acb 100644 --- a/jstests/sharding/authCommands.js +++ b/jstests/sharding/authCommands.js @@ -69,7 +69,8 @@ testDB.getLastError( 'majority' ); assert.eq(1000, testDB.foo.count()); // Wait for the balancer to start back up -st.startBalancer() +assert.writeOK(configDB.settings.update({_id: 'balancer'}, {$set: {_waitForDelete: true}}, true)); +st.startBalancer(); // Make sure we've done at least some splitting, so the balancer will work assert.gt( configDB.chunks.find({ ns : 'test.foo' }).count(), 2 ) @@ -81,12 +82,7 @@ assert.soon( function() { return x < 2 && configDB.locks.findOne({ _id : 'test.foo' }).state == 0; }, "no balance happened", 5 * 60 * 1000 ); -assert.soon( function(){ - print( "Waiting for migration cleanup to occur..." ) - return testDB.foo.find().itcount() == testDB.foo.count(); -}) - -var map = function() { emit (this.i, this.j) }; +var map = function() { emit (this.i, this.j); }; var reduce = function( key, values ) { var jCount = 0; values.forEach( function(j) { jCount += j; } ); -- cgit v1.2.3