summaryrefslogtreecommitdiff
path: root/jstests/noPassthrough/repair2.js
diff options
context:
space:
mode:
Diffstat (limited to 'jstests/noPassthrough/repair2.js')
-rw-r--r--jstests/noPassthrough/repair2.js19
1 files changed, 9 insertions, 10 deletions
diff --git a/jstests/noPassthrough/repair2.js b/jstests/noPassthrough/repair2.js
index e80a3edf02b..6f57ac0d45f 100644
--- a/jstests/noPassthrough/repair2.js
+++ b/jstests/noPassthrough/repair2.js
@@ -9,8 +9,8 @@ t = testServer.getDB( baseName )[ baseName ];
t.drop();
function protect( f ) {
- try {
- f();
+ try {
+ f();
} catch( e ) {
printjson( e );
}
@@ -19,17 +19,16 @@ function protect( f ) {
s = startParallelShell( "db = db.getSisterDB( '" + baseName + "'); for( i = 0; i < 10; ++i ) { db.repairDatabase(); sleep( 5000 ); }" );
for( i = 0; i < 30; ++i ) {
- var bulk = t.initializeUnorderedBulkOp();
- for( j = 0; j < 5000; ++j ) {
- bulk.insert({ _id: j } );
- }
- for( j = 0; j < 5000; ++j ) {
- bulk.find({ _id: j }).remove();
+ for( j = 0; j < 5000; ++j ) {
+ protect( function() { t.insert( {_id:j} ); } );
}
- assert.writeOK(bulk.execute());
- assert.eq( 0, t.count() );
+ for( j = 0; j < 5000; ++j ) {
+ protect( function() { t.remove( {_id:j} ); } );
+ }
+
+ assert.eq( 0, t.count() );
}