diff options
Diffstat (limited to 'jstests/noPassthroughWithMongod/index_check9.js')
-rw-r--r-- | jstests/noPassthroughWithMongod/index_check9.js | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/jstests/noPassthroughWithMongod/index_check9.js b/jstests/noPassthroughWithMongod/index_check9.js index 8a50471940b..fd1b1d5eaa1 100644 --- a/jstests/noPassthroughWithMongod/index_check9.js +++ b/jstests/noPassthroughWithMongod/index_check9.js @@ -106,25 +106,32 @@ function check() { assert.eq( c3.length, count ); } +var bulk = t.initializeUnorderedBulkOp(); for( var i = 0; i < 10000; ++i ) { - t.save( obj() ); + bulk.insert( obj() ); if( Random.rand() > 0.999 ) { print( i ); + assert.writeOK(bulk.execute()); check(); + bulk = t.initializeUnorderedBulkOp(); } } +bulk = t.initializeUnorderedBulkOp(); for( var i = 0; i < 100000; ++i ) { if ( Random.rand() > 0.9 ) { - t.save( obj() ); + bulk.insert( obj() ); } else { - t.remove( obj() ); // improve + bulk.find( obj() ).remove(); // improve } if( Random.rand() > 0.999 ) { print( i ); + assert.writeOK(bulk.execute()); check(); + bulk = t.initializeUnorderedBulkOp(); } } +assert.writeOK(bulk.execute()); check(); @@ -132,4 +139,4 @@ check(); for( var z = 0; z < 5; ++z ) { doIt(); -}
\ No newline at end of file +} |