mirror of
https://github.com/mongodb/mongo.git
synced 2024-11-30 00:56:44 +01:00
fixing tests
This commit is contained in:
parent
5f6aa4f67d
commit
77ccdaa8e5
@ -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