mirror of
https://github.com/mongodb/mongo.git
synced 2024-11-30 09:06:21 +01:00
Merge branch 'master' of git@github.com:mongodb/mongo
This commit is contained in:
commit
cf2a7284d1
@ -3,7 +3,7 @@
|
||||
//
|
||||
var files = listFiles("jstests");
|
||||
|
||||
db.runCommand( "closeAllDatabases" );
|
||||
db.getSisterDB( "admin" ).runCommand( "closeAllDatabases" );
|
||||
prev = db.runCommand( "meminfo" );
|
||||
|
||||
print( "START : " + tojson( prev ) );
|
||||
@ -33,5 +33,5 @@ files.forEach(
|
||||
|
||||
|
||||
|
||||
db.runCommand( "closeAllDatabases" );
|
||||
db.getSisterDB( "admin" ).runCommand( "closeAllDatabases" );
|
||||
print( "END : " + tojson( db.runCommand( "meminfo" ) ) );
|
||||
|
40
jstests/_runner_leak_nojni.js
Normal file
40
jstests/_runner_leak_nojni.js
Normal file
@ -0,0 +1,40 @@
|
||||
//
|
||||
// simple runner to run toplevel tests in jstests
|
||||
//
|
||||
var files = listFiles("jstests");
|
||||
|
||||
db.getSisterDB( "admin" ).runCommand( "closeAllDatabases" );
|
||||
prev = db.runCommand( "meminfo" );
|
||||
|
||||
print( "START : " + tojson( prev ) );
|
||||
|
||||
files.forEach(
|
||||
function(x) {
|
||||
|
||||
if ( /_runner/.test(x.name) ||
|
||||
/_lodeRunner/.test(x.name) ||
|
||||
/jni/.test(x.name) ||
|
||||
/eval/.test(x.name) ||
|
||||
/where/.test(x.name) ||
|
||||
! /\.js$/.test(x.name ) ){
|
||||
print(" >>>>>>>>>>>>>>> skipping " + x.name);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
print(" *******************************************");
|
||||
print(" Test : " + x.name + " ...");
|
||||
print(" " + Date.timeFunc( function() { load(x.name); }, 1) + "ms");
|
||||
|
||||
assert( db.getSisterDB( "admin" ).runCommand( "closeAllDatabases" ).ok == 1 , "closeAllDatabases failed" );
|
||||
var now = db.runCommand( "meminfo" );
|
||||
if ( now.virtual > prev.virtual )
|
||||
print( " LEAK : " + prev.virtual + " -->> " + now.virtual );
|
||||
prev = now;
|
||||
}
|
||||
);
|
||||
|
||||
|
||||
|
||||
db.getSisterDB( "admin" ).runCommand( "closeAllDatabases" );
|
||||
print( "END : " + tojson( db.runCommand( "meminfo" ) ) );
|
@ -68,26 +68,3 @@ assert( asserted );
|
||||
|
||||
dd( "g" );
|
||||
|
||||
/*
|
||||
* dbEval tested via collections count function
|
||||
*/
|
||||
|
||||
/*
|
||||
* db group
|
||||
*/
|
||||
|
||||
db.getCollection( "test" ).drop();
|
||||
db.getCollection( "test" ).save({a:1});
|
||||
db.getCollection( "test" ).save({a:1});
|
||||
|
||||
var f = db.group(
|
||||
{
|
||||
ns: "test",
|
||||
key: { a:true},
|
||||
cond: { a:1 },
|
||||
reduce: function(obj,prev) { prev.csum++; } ,
|
||||
initial: { csum: 0}
|
||||
}
|
||||
);
|
||||
|
||||
assert(f[0].a == 1 && f[0].csum == 2);
|
||||
|
18
jstests/eval2.js
Normal file
18
jstests/eval2.js
Normal file
@ -0,0 +1,18 @@
|
||||
|
||||
t = db.test;
|
||||
t.drop();
|
||||
t.save({a:1});
|
||||
t.save({a:1});
|
||||
|
||||
var f = db.group(
|
||||
{
|
||||
ns: "test",
|
||||
key: { a:true},
|
||||
cond: { a:1 },
|
||||
reduce: function(obj,prev) { prev.csum++; } ,
|
||||
initial: { csum: 0}
|
||||
}
|
||||
);
|
||||
|
||||
assert(f[0].a == 1 && f[0].csum == 2);
|
||||
|
Loading…
Reference in New Issue
Block a user