diff options
author | Mike Grundy <michael.grundy@10gen.com> | 2016-02-04 12:31:21 -0500 |
---|---|---|
committer | Mike Grundy <michael.grundy@10gen.com> | 2016-02-05 15:00:52 -0500 |
commit | f48ed9956e605bfe9816cbaf045652d8e003897e (patch) | |
tree | 9ac1d7bf01d792ecebf9d8a7bcf6351394ed78b2 | |
parent | c86e2cdec27d7fe90dc8e3f056adff2848dd1839 (diff) | |
download | mongo-f48ed9956e605bfe9816cbaf045652d8e003897e.tar.gz |
SERVER-22341 fix jslint errors in jstests/slow2 with eslint --fix
-rw-r--r-- | jstests/slow2/32bit.js | 2 | ||||
-rw-r--r-- | jstests/slow2/conc_update.js | 26 | ||||
-rw-r--r-- | jstests/slow2/mr_during_migrate.js | 78 |
3 files changed, 53 insertions, 53 deletions
diff --git a/jstests/slow2/32bit.js b/jstests/slow2/32bit.js index 91ac9082d6a..f76b04e5c21 100644 --- a/jstests/slow2/32bit.js +++ b/jstests/slow2/32bit.js @@ -7,7 +7,7 @@ var forceSeedToBe = null; if (forceSeedToBe) { print("\n32bit.js WARNING FORCING A SPECIFIC SEED"); - print("seed="+ forceSeedToBe) + print("seed="+ forceSeedToBe); Random.srand(forceSeedToBe); } else { diff --git a/jstests/slow2/conc_update.js b/jstests/slow2/conc_update.js index 4ee5bd22ca7..5cde7489090 100644 --- a/jstests/slow2/conc_update.js +++ b/jstests/slow2/conc_update.js @@ -1,21 +1,21 @@ -load( "jstests/libs/slow_weekly_util.js" ) -test = new SlowWeeklyMongod( "conc_update" ) -db = test.getDB("concurrency") +load( "jstests/libs/slow_weekly_util.js" ); +test = new SlowWeeklyMongod( "conc_update" ); +db = test.getDB("concurrency"); db.dropDatabase(); -NRECORDS=3*1024*1024 +NRECORDS=3*1024*1024; -print("loading "+NRECORDS+" documents (progress msg every 1024*1024 documents)") +print("loading "+NRECORDS+" documents (progress msg every 1024*1024 documents)"); var bulk = db.conc.initializeUnorderedBulkOp(); for (var i = 0; i < NRECORDS; i++) { bulk.insert({ x: i }); } assert.writeOK(bulk.execute()); -print("making an index (this will take a while)") -db.conc.ensureIndex({x:1}) +print("making an index (this will take a while)"); +db.conc.ensureIndex({x:1}); -var c1=db.conc.count({x:{$lt:NRECORDS}}) +var c1=db.conc.count({x:{$lt:NRECORDS}}); updater = startParallelShell("db = db.getSisterDB('concurrency');\ db.concflag.insert({ inprog: true });\ @@ -29,11 +29,11 @@ assert.soon( function(){ var x = db.concflag.findOne(); return x && x.inprog; } querycount=0; decrements=0; -misses=0 +misses=0; assert.soon(function(){ - c2=db.conc.count({x:{$lt:NRECORDS}}) - print(c2) + c2=db.conc.count({x:{$lt:NRECORDS}}); + print(c2); querycount++; if (c2<c1) decrements++; @@ -45,8 +45,8 @@ assert.soon(function(){ print(querycount + " queries, " + decrements + " decrements, " + misses + " misses"); -assert.eq( NRECORDS , db.conc.count() , "AT END 1" ) +assert.eq( NRECORDS , db.conc.count() , "AT END 1" ); -updater() // wait() +updater(); // wait() test.stop(); diff --git a/jstests/slow2/mr_during_migrate.js b/jstests/slow2/mr_during_migrate.js index ae0ae7ce0fe..66962ff0e0f 100644 --- a/jstests/slow2/mr_during_migrate.js +++ b/jstests/slow2/mr_during_migrate.js @@ -1,21 +1,21 @@ // Do parallel ops with migrates occurring -var st = new ShardingTest({ shards : 10, mongos : 2, verbose : 2 }) +var st = new ShardingTest({ shards : 10, mongos : 2, verbose : 2 }); -jsTest.log( "Doing parallel operations..." ) +jsTest.log( "Doing parallel operations..." ); //Stop balancer, since it'll just get in the way of these -st.stopBalancer() +st.stopBalancer(); -var mongos = st.s0 -var admin = mongos.getDB("admin") -var coll = st.s.getCollection( jsTest.name() + ".coll" ) +var mongos = st.s0; +var admin = mongos.getDB("admin"); +var coll = st.s.getCollection( jsTest.name() + ".coll" ); -var numDocs = 1024 * 1024 -var dataSize = 1024 // bytes, must be power of 2 +var numDocs = 1024 * 1024; +var dataSize = 1024; // bytes, must be power of 2 -var data = "x" -while( data.length < dataSize ) data += data +var data = "x"; +while( data.length < dataSize ) data += data; var bulk = coll.initializeUnorderedBulkOp(); for( var i = 0; i < numDocs; i++ ){ @@ -24,22 +24,22 @@ for( var i = 0; i < numDocs; i++ ){ assert.writeOK(bulk.execute()); // Make sure everything got inserted -assert.eq( numDocs, coll.find().itcount() ) +assert.eq( numDocs, coll.find().itcount() ); -jsTest.log( "Inserted " + sh._dataFormat( dataSize * numDocs ) + " of data." ) +jsTest.log( "Inserted " + sh._dataFormat( dataSize * numDocs ) + " of data." ); // Shard collection -st.shardColl( coll, { _id : 1 }, false ) +st.shardColl( coll, { _id : 1 }, false ); -st.printShardingStatus() +st.printShardingStatus(); -jsTest.log( "Sharded collection now initialized, starting migrations..." ) +jsTest.log( "Sharded collection now initialized, starting migrations..." ); -var checkMigrate = function(){ print( "Result of migrate : " ); printjson( this ) } +var checkMigrate = function(){ print( "Result of migrate : " ); printjson( this ); }; // Creates a number of migrations of random chunks to diff shard servers -var ops = [] +var ops = []; for(var i = 0; i < st._connections.length; i++) { ops.push({ op: "command", @@ -56,55 +56,55 @@ for(var i = 0; i < st._connections.length; i++) { // TODO: Also migrate output collection -jsTest.log( "Starting migrations now..." ) +jsTest.log( "Starting migrations now..." ); var bid = benchStart({ ops : ops, host : st.s.host, parallel : 1, - handleErrors : false }) + handleErrors : false }); //####################### // Tests during migration -var numTests = 5 +var numTests = 5; for( var t = 0; t < numTests; t++ ){ - jsTest.log( "Test #" + t ) + jsTest.log( "Test #" + t ); - var mongos = st.s1 // use other mongos so we get stale shard versions - var coll = mongos.getCollection( coll + "" ) - var outputColl = mongos.getCollection( coll + "_output" ) + var mongos = st.s1; // use other mongos so we get stale shard versions + var coll = mongos.getCollection( coll + "" ); + var outputColl = mongos.getCollection( coll + "_output" ); - var numTypes = 32 - var map = function(){ emit( this._id % 32 /* must be hardcoded */, { c : 1 } ) } + var numTypes = 32; + var map = function(){ emit( this._id % 32 /* must be hardcoded */, { c : 1 } ); }; var reduce = function( k, vals ){ - var total = 0 - for( var i = 0; i < vals.length; i++ ) total += vals[i].c - return { c : total } - } + var total = 0; + for( var i = 0; i < vals.length; i++ ) total += vals[i].c; + return { c : total }; + }; - printjson( coll.find({ _id : 0 }).itcount() ) + printjson( coll.find({ _id : 0 }).itcount() ); - jsTest.log( "Starting new mapReduce run #" + t ) + jsTest.log( "Starting new mapReduce run #" + t ); //assert.eq( coll.find().itcount(), numDocs ) - coll.getMongo().getDB("admin").runCommand({ setParameter : 1, traceExceptions : true }) + coll.getMongo().getDB("admin").runCommand({ setParameter : 1, traceExceptions : true }); printjson( coll.mapReduce( map, reduce, { out : { replace : outputColl.getName(), db : outputColl.getDB() + "" } }) ); - jsTest.log( "MapReduce run #" + t + " finished." ) + jsTest.log( "MapReduce run #" + t + " finished." ); - assert.eq( outputColl.find().itcount(), numTypes ) + assert.eq( outputColl.find().itcount(), numTypes ); outputColl.find().forEach( function( x ){ - assert.eq( x.value.c, numDocs / numTypes ) - }) + assert.eq( x.value.c, numDocs / numTypes ); + }); } -printjson( benchFinish( bid ) ) +printjson( benchFinish( bid ) ); -st.stop() +st.stop(); |