summaryrefslogtreecommitdiff
path: root/jstests/noPassthrough/update_server-5552.js
diff options
context:
space:
mode:
Diffstat (limited to 'jstests/noPassthrough/update_server-5552.js')
-rw-r--r--jstests/noPassthrough/update_server-5552.js28
1 files changed, 19 insertions, 9 deletions
diff --git a/jstests/noPassthrough/update_server-5552.js b/jstests/noPassthrough/update_server-5552.js
index 9459cfcc95e..146dd0dab31 100644
--- a/jstests/noPassthrough/update_server-5552.js
+++ b/jstests/noPassthrough/update_server-5552.js
@@ -1,6 +1,6 @@
-load( "jstests/libs/slow_weekly_util.js" );
-testServer = new SlowWeeklyMongod( "update_server-5552" );
-db = testServer.getDB( "test" );
+load("jstests/libs/slow_weekly_util.js");
+testServer = new SlowWeeklyMongod("update_server-5552");
+db = testServer.getDB("test");
t = db.foo;
t.drop();
@@ -8,18 +8,28 @@ t.drop();
N = 10000;
var bulk = t.initializeUnorderedBulkOp();
-for ( i=0; i<N; i++ ) {
- bulk.insert({ _id: i, x: 1 });
+for (i = 0; i < N; i++) {
+ bulk.insert({_id: i, x: 1});
}
assert.writeOK(bulk.execute());
-join = startParallelShell( "while( db.foo.findOne( { _id : 0 } ).x == 1 ); db.foo.ensureIndex( { x : 1 } );" );
-
-t.update( { $where : function(){ sleep(1); return true; } } , { $set : { x : 5 } } , false , true );
+join = startParallelShell(
+ "while( db.foo.findOne( { _id : 0 } ).x == 1 ); db.foo.ensureIndex( { x : 1 } );");
+
+t.update(
+ {
+ $where: function() {
+ sleep(1);
+ return true;
+ }
+ },
+ {$set: {x: 5}},
+ false,
+ true);
db.getLastError();
join();
-assert.eq( N , t.find( { x : 5 } ).count() );
+assert.eq(N, t.find({x: 5}).count());
testServer.stop();