From c22ef261c9701e742d0ec2a970822bc135a83c1b Mon Sep 17 00:00:00 2001 From: Eliot Horowitz Date: Mon, 8 Aug 2011 01:13:53 -0400 Subject: [PATCH] make test more reliable --- jstests/slowNightly/sharding_migrateBigObject.js | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/jstests/slowNightly/sharding_migrateBigObject.js b/jstests/slowNightly/sharding_migrateBigObject.js index d8ff740d81d..537643d9523 100644 --- a/jstests/slowNightly/sharding_migrateBigObject.js +++ b/jstests/slowNightly/sharding_migrateBigObject.js @@ -10,10 +10,8 @@ var admin = mongos.getDB("admin") admin.runCommand({ addshard : "localhost:30001" }) admin.runCommand({ addshard : "localhost:30002" }) - - -var coll = mongos.getDB("test").getCollection("stuff") -coll.drop() +db = mongos.getDB("test"); +var coll = db.getCollection("stuff") var data = "x" var nsq = 16 @@ -28,6 +26,9 @@ for( var i = 0; i < 40; i++ ) { if(i != 0 && i % 10 == 0) printjson( coll.stats() ) coll.save({ data : dataObj }) } +db.getLastError(); + +assert.eq( 40 , coll.count() , "prep1" ); printjson( coll.stats() ) @@ -37,6 +38,8 @@ admin.printShardingStatus() admin.runCommand({ shardcollection : "" + coll, key : { _id : 1 } }) +assert.lt( 5 , mongos.getDB( "config" ).chunks.find( { ns : "test.stuff" } ).count() , "not enough chunks" ); + assert.soon( function(){ res = mongos.getDB( "config" ).chunks.group( { cond : { ns : "test.stuff" } ,