// auto2.js s = new ShardingTest( "auto2" , 2 , 1 , 2 ); s.adminCommand( { enablesharding : "test" } ); s.adminCommand( { shardcollection : "test.foo" , key : { num : 1 } } ); bigString = ""; while ( bigString.length < 1024 * 50 ) bigString += "asocsancdnsjfnsdnfsjdhfasdfasdfasdfnsadofnsadlkfnsaldknfsad"; db = s.getDB( "test" ) coll = db.foo; var i=0; for ( j=0; j<30; j++ ){ print( "j:" + j + " : " + Date.timeFunc( function(){ for ( var k=0; k<100; k++ ){ coll.save( { num : i , s : bigString } ); i++; } } ) ); } assert.eq( i , j * 100 , "setup" ); // Until SERVER-9715 is fixed, the sync command must be run on a diff connection new Mongo( s.s.host ).adminCommand( "connpoolsync" ); db.getLastError(); print( "done inserting data" ); print( "datasize: " + tojson( s.getServer( "test" ).getDB( "admin" ).runCommand( { datasize : "test.foo" } ) ) ); s.printChunks(); function doCountsGlobal(){ counta = s._connections[0].getDB( "test" ).foo.count(); countb = s._connections[1].getDB( "test" ).foo.count(); return counta + countb; } // Wait for the chunks to distribute assert.soon( function(){ doCountsGlobal() print( "Counts: " + counta + countb) return counta > 0 && countb > 0 }) print( "checkpoint B" ) var missing = []; for ( i=0; i 30 ? 30 : x.length ) ) } ) } ) print( "checkpoint H") s.stop();