Skip to content

Commit 8ca7124

Browse files
author
Mike Grundy
committed
SERVER-22341 fix jslint errors in jstests/noPassthroughWithMongod with eslint --fix
1 parent b4b016d commit 8ca7124

34 files changed

+204
-204
lines changed

jstests/noPassthroughWithMongod/benchrun_substitution.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ function benchrun_sub_remove(use_write_command) {
6161
ops = [{op: "remove", ns: "test.benchrun_sub",
6262
query: {x: {"#RAND_INT": [0, 100]}},
6363
writeCmd: use_write_command,
64-
}]
64+
}];
6565

6666
for (var i = 0; i < 100; ++i) {
6767
t.insert({x: i});

jstests/noPassthroughWithMongod/bulk_api_limits.js

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ var executeTestsUnordered = function() {
2626
var hugeString = "";
2727
// Create it bigger than 16MB
2828
for(var i = 0; i < (1024 * 1100); i++) {
29-
hugeString = hugeString + "1234567890123456"
29+
hugeString = hugeString + "1234567890123456";
3030
}
3131

3232
// Set up the batch
@@ -49,7 +49,7 @@ var executeTestsUnordered = function() {
4949
var hugeString = "";
5050
// Create 4 MB strings to test splitting
5151
for(var i = 0; i < (1024 * 256); i++) {
52-
hugeString = hugeString + "1234567890123456"
52+
hugeString = hugeString + "1234567890123456";
5353
}
5454

5555
// Insert the string a couple of times, should force split into multiple batches
@@ -61,12 +61,12 @@ var executeTestsUnordered = function() {
6161
batch.insert({a:5, b: hugeString});
6262
batch.insert({a:6, b: hugeString});
6363
var result = batch.execute();
64-
printjson(JSON.stringify(result))
64+
printjson(JSON.stringify(result));
6565

6666
// Basic properties check
6767
assert.eq(6, result.nInserted);
6868
assert.eq(false, result.hasWriteErrors());
69-
}
69+
};
7070

7171
/********************************************************
7272
*
@@ -82,7 +82,7 @@ var executeTestsOrdered = function() {
8282
var hugeString = "";
8383
// Create it bigger than 16MB
8484
for(var i = 0; i < (1024 * 1100); i++) {
85-
hugeString = hugeString + "1234567890123456"
85+
hugeString = hugeString + "1234567890123456";
8686
}
8787

8888
// Set up the batch
@@ -105,7 +105,7 @@ var executeTestsOrdered = function() {
105105
var hugeString = "";
106106
// Create 4 MB strings to test splitting
107107
for(var i = 0; i < (1024 * 256); i++) {
108-
hugeString = hugeString + "1234567890123456"
108+
hugeString = hugeString + "1234567890123456";
109109
}
110110

111111
// Insert the string a couple of times, should force split into multiple batches
@@ -125,7 +125,7 @@ var executeTestsOrdered = function() {
125125
// Create unique index
126126
coll.dropIndexes();
127127
coll.remove({});
128-
}
128+
};
129129

130130
var buildVersion = parseInt(db.runCommand({buildInfo:1}).versionArray.slice(0, 3).join(""), 10);
131131
// Save the existing useWriteCommands function
@@ -138,7 +138,7 @@ if(buildVersion >= 255) {
138138
// Force the use of useWriteCommands
139139
coll._mongo.useWriteCommands = function() {
140140
return true;
141-
}
141+
};
142142

143143
// Execute tests using legacy operations
144144
executeTestsUnordered();
@@ -148,7 +148,7 @@ if(buildVersion >= 255) {
148148
// Force the use of legacy commands
149149
coll._mongo.useWriteCommands = function() {
150150
return false;
151-
}
151+
};
152152

153153
// Execute tests using legacy operations
154154
executeTestsUnordered();

jstests/noPassthroughWithMongod/clonecollection.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@ if ( t.a.getIndexes().length != 2 ) {
3030
}
3131
assert.eq( 2, t.a.getIndexes().length, "expected index missing" );
3232
// Verify index works
33-
x = t.a.find( { i: 50 } ).hint( { i: 1 } ).explain("executionStats")
34-
printjson( x )
33+
x = t.a.find( { i: 50 } ).hint( { i: 1 } ).explain("executionStats");
34+
printjson( x );
3535
assert.eq( 1, x.executionStats.nReturned , "verify 1" );
3636
assert.eq( 1, t.a.find( { i: 50 } ).hint( { i: 1 } ).toArray().length, "match length did not match expected" );
3737

jstests/noPassthroughWithMongod/connections_opened.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ function createTemporaryConnection() {
3232
"assert.soon(function() {" +
3333
"try { conn = new Mongo(\"" + db.getMongo().host + "\"); return conn" +
3434
"} catch (x) {return false;}}, " +
35-
"\"Timed out waiting for temporary connection to connect\", 30000, 5000);"
35+
"\"Timed out waiting for temporary connection to connect\", 30000, 5000);";
3636
// Poll the signal collection until it is told to terminate.
3737
pollString += "assert.soon(function() {"
3838
+ "return conn.getDB('" + testDB + "').getCollection('" + signalCollection + "')"

jstests/noPassthroughWithMongod/dup_bgindex.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ t.drop();
55
for (var i=0; i<10000; i++) {
66
t.insert( { name : "foo" , z : { a : 17 , b : 4}, i: i } );
77
}
8-
var cmd = "db.duplIndexTest.ensureIndex( { i : 1 }, {background:true} );"
8+
var cmd = "db.duplIndexTest.ensureIndex( { i : 1 }, {background:true} );";
99
var join1 = startParallelShell(cmd);
1010
var join2 = startParallelShell(cmd);
1111
t.ensureIndex( { i : 1 }, {background:true} );

jstests/noPassthroughWithMongod/geo_axis_aligned.js

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,46 +1,46 @@
11
// Axis aligned circles - hard-to-find precision errors possible with exact distances here
22

3-
t = db.axisaligned
3+
t = db.axisaligned;
44
t.drop();
55

6-
scale = [ 1, 10, 1000, 10000 ]
7-
bits = [ 2, 3, 4, 5, 6, 7, 8, 9 ]
8-
radius = [ 0.0001, 0.001, 0.01, 0.1 ]
9-
center = [ [ 5, 52 ], [ 6, 53 ], [ 7, 54 ], [ 8, 55 ], [ 9, 56 ] ]
6+
scale = [ 1, 10, 1000, 10000 ];
7+
bits = [ 2, 3, 4, 5, 6, 7, 8, 9 ];
8+
radius = [ 0.0001, 0.001, 0.01, 0.1 ];
9+
center = [ [ 5, 52 ], [ 6, 53 ], [ 7, 54 ], [ 8, 55 ], [ 9, 56 ] ];
1010

11-
bound = []
11+
bound = [];
1212
for( var j = 0; j < center.length; j++ ) bound.push( [-180, 180] );
1313

1414
// Scale all our values to test different sizes
15-
radii = []
16-
centers = []
17-
bounds = []
15+
radii = [];
16+
centers = [];
17+
bounds = [];
1818

1919
for( var s = 0; s < scale.length; s++ ){
2020
for ( var i = 0; i < radius.length; i++ ) {
21-
radii.push( radius[i] * scale[s] )
21+
radii.push( radius[i] * scale[s] );
2222
}
2323

2424
for ( var j = 0; j < center.length; j++ ) {
25-
centers.push( [ center[j][0] * scale[s], center[j][1] * scale[s] ] )
26-
bounds.push( [ bound[j][0] * scale[s], bound[j][1] * scale[s] ] )
25+
centers.push( [ center[j][0] * scale[s], center[j][1] * scale[s] ] );
26+
bounds.push( [ bound[j][0] * scale[s], bound[j][1] * scale[s] ] );
2727
}
2828
}
2929

30-
radius = radii
31-
center = centers
32-
bound = bounds
30+
radius = radii;
31+
center = centers;
32+
bound = bounds;
3333

3434

3535
for ( var b = 0; b < bits.length; b++ ) {
36-
printjson( radius )
37-
printjson( centers )
36+
printjson( radius );
37+
printjson( centers );
3838

3939
for ( var i = 0; i < radius.length; i++ ) {
4040
for ( var j = 0; j < center.length; j++ ) {
4141
printjson( { center : center[j], radius : radius[i], bits : bits[b] } );
4242

43-
t.drop()
43+
t.drop();
4444

4545
// Make sure our numbers are precise enough for this test
4646
if( (center[j][0] - radius[i] == center[j][0]) || (center[j][1] - radius[i] == center[j][1]) )
@@ -65,7 +65,7 @@ for ( var b = 0; b < bits.length; b++ ) {
6565
// These are invalid cases, so we skip them.
6666
if (!res.ok) continue;
6767

68-
print( "DOING WITHIN QUERY ")
68+
print( "DOING WITHIN QUERY ");
6969
r = t.find( { "loc" : { "$within" : { "$center" : [ center[j], radius[i] ] } } } );
7070

7171
assert.eq( 5, r.count() );
@@ -74,18 +74,18 @@ for ( var b = 0; b < bits.length; b++ ) {
7474
a = r.toArray();
7575
x = [];
7676
for ( k in a )
77-
x.push( a[k]["_id"] )
78-
x.sort()
77+
x.push( a[k]["_id"] );
78+
x.sort();
7979
assert.eq( [ 1, 2, 3, 4, 5 ], x );
8080

81-
print( " DOING NEAR QUERY ")
81+
print( " DOING NEAR QUERY ");
8282
//printjson( center[j] )
83-
r = t.find( { loc : { $near : center[j], $maxDistance : radius[i] } }, { _id : 1 } )
83+
r = t.find( { loc : { $near : center[j], $maxDistance : radius[i] } }, { _id : 1 } );
8484
assert.eq( 5, r.count() );
8585

86-
print( " DOING DIST QUERY ")
86+
print( " DOING DIST QUERY ");
8787

88-
a = db.runCommand({ geoNear : "axisaligned", near : center[j], maxDistance : radius[i] }).results
88+
a = db.runCommand({ geoNear : "axisaligned", near : center[j], maxDistance : radius[i] }).results;
8989
assert.eq( 5, a.length );
9090

9191
var distance = 0;
Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,53 +1,53 @@
11
// Test sanity of geo queries with a lot of points
22

3-
var coll = db.testMnyPts
4-
coll.drop()
3+
var coll = db.testMnyPts;
4+
coll.drop();
55

6-
var totalPts = 500 * 1000
6+
var totalPts = 500 * 1000;
77

88
// Add points in a 100x100 grid
99
var bulk = coll.initializeUnorderedBulkOp();
1010
for( var i = 0; i < totalPts; i++ ){
11-
var ii = i % 10000
11+
var ii = i % 10000;
1212
bulk.insert({ loc : [ ii % 100, Math.floor( ii / 100 ) ] });
1313
}
1414
assert.writeOK(bulk.execute());
1515

16-
coll.ensureIndex({ loc : "2d" })
16+
coll.ensureIndex({ loc : "2d" });
1717

1818
// Check that quarter of points in each quadrant
1919
for( var i = 0; i < 4; i++ ){
20-
var x = i % 2
21-
var y = Math.floor( i / 2 )
20+
var x = i % 2;
21+
var y = Math.floor( i / 2 );
2222

23-
var box = [[0, 0], [49, 49]]
24-
box[0][0] += ( x == 1 ? 50 : 0 )
25-
box[1][0] += ( x == 1 ? 50 : 0 )
26-
box[0][1] += ( y == 1 ? 50 : 0 )
27-
box[1][1] += ( y == 1 ? 50 : 0 )
23+
var box = [[0, 0], [49, 49]];
24+
box[0][0] += ( x == 1 ? 50 : 0 );
25+
box[1][0] += ( x == 1 ? 50 : 0 );
26+
box[0][1] += ( y == 1 ? 50 : 0 );
27+
box[1][1] += ( y == 1 ? 50 : 0 );
2828

29-
assert.eq( totalPts / 4, coll.find({ loc : { $within : { $box : box } } }).count() )
30-
assert.eq( totalPts / 4, coll.find({ loc : { $within : { $box : box } } }).itcount() )
29+
assert.eq( totalPts / 4, coll.find({ loc : { $within : { $box : box } } }).count() );
30+
assert.eq( totalPts / 4, coll.find({ loc : { $within : { $box : box } } }).itcount() );
3131

3232
}
3333

3434
// Check that half of points in each half
3535
for( var i = 0; i < 2; i++ ){
3636

37-
var box = [[0, 0], [49, 99]]
38-
box[0][0] += ( i == 1 ? 50 : 0 )
39-
box[1][0] += ( i == 1 ? 50 : 0 )
37+
var box = [[0, 0], [49, 99]];
38+
box[0][0] += ( i == 1 ? 50 : 0 );
39+
box[1][0] += ( i == 1 ? 50 : 0 );
4040

41-
assert.eq( totalPts / 2, coll.find({ loc : { $within : { $box : box } } }).count() )
42-
assert.eq( totalPts / 2, coll.find({ loc : { $within : { $box : box } } }).itcount() )
41+
assert.eq( totalPts / 2, coll.find({ loc : { $within : { $box : box } } }).count() );
42+
assert.eq( totalPts / 2, coll.find({ loc : { $within : { $box : box } } }).itcount() );
4343

4444
}
4545

4646
// Check that all but corner set of points in radius
47-
var circle = [[0, 0], (100 - 1) * Math.sqrt( 2 ) - 0.25 ]
47+
var circle = [[0, 0], (100 - 1) * Math.sqrt( 2 ) - 0.25 ];
4848

49-
assert.eq( totalPts - totalPts / ( 100 * 100 ), coll.find({ loc : { $within : { $center : circle } } }).count() )
50-
assert.eq( totalPts - totalPts / ( 100 * 100 ), coll.find({ loc : { $within : { $center : circle } } }).itcount() )
49+
assert.eq( totalPts - totalPts / ( 100 * 100 ), coll.find({ loc : { $within : { $center : circle } } }).count() );
50+
assert.eq( totalPts - totalPts / ( 100 * 100 ), coll.find({ loc : { $within : { $center : circle } } }).itcount() );
5151

5252

5353

jstests/noPassthroughWithMongod/geo_near_random2.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ test.testPt(test.mkPt(), opts);
1212
test.testPt(test.mkPt(), opts);
1313
test.testPt(test.mkPt(), opts);
1414

15-
opts.sphere = 1
15+
opts.sphere = 1;
1616
test.testPt([0,0], opts);
1717
test.testPt(test.mkPt(0.8), opts);
1818
test.testPt(test.mkPt(0.8), opts);

jstests/noPassthroughWithMongod/geo_polygon.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ assert.writeOK(bulk.execute());
1313

1414
var numTests = 31;
1515
for( var n = 0; n < numTests; n++ ){
16-
t.dropIndexes()
16+
t.dropIndexes();
1717
t.ensureIndex( { loc : "2d" }, { bits : 2 + n } );
1818

1919
assert.between( 9 - 2 , t.find( { loc: { "$within": { "$polygon" : [[0,0], [1,1], [0,2]] }}} ).count() , 9, "Triangle Test", true);
Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
// https://jira.mongodb.org/browse/SERVER-4534
22
// Building an index in the forground on a field with a large array and few documents in
33
// the collection used to open too many files and crash the server.
4-
t = db.huge_multikey_index
5-
t.drop()
4+
t = db.huge_multikey_index;
5+
t.drop();
66

77
function doit() {
8-
arr = []
8+
arr = [];
99
for (var i=0; i< 1000*1000;i++)
1010
arr.push(i);
1111

12-
t.insert({a:arr})
12+
t.insert({a:arr});
1313

1414
//t.ensureIndex({a:1}, {background:true}) // always worked
1515

16-
t.ensureIndex({a:1}) // used to fail server with out of fds error
16+
t.ensureIndex({a:1}); // used to fail server with out of fds error
1717
}
1818

1919
doit();

0 commit comments

Comments
 (0)