summaryrefslogtreecommitdiff
path: root/jstests/_runner_leak.js
diff options
context:
space:
mode:
authorEliot Horowitz <eliot@10gen.com>2009-02-20 09:34:25 -0500
committerEliot Horowitz <eliot@10gen.com>2009-02-20 09:34:25 -0500
commit3f5102bf27fd120b696c78d16668c4ba2a5f0475 (patch)
tree681380deb679a5ef108511b5c1eb067a3739c8cd /jstests/_runner_leak.js
parentb911ce8b250e3df57e8dd6e72cabd212972ef808 (diff)
downloadmongo-3f5102bf27fd120b696c78d16668c4ba2a5f0475.tar.gz
processinfo class and meminfo command, only works on darwin for the moment
Diffstat (limited to 'jstests/_runner_leak.js')
-rw-r--r--jstests/_runner_leak.js33
1 files changed, 33 insertions, 0 deletions
diff --git a/jstests/_runner_leak.js b/jstests/_runner_leak.js
new file mode 100644
index 00000000000..f4ed85f33c0
--- /dev/null
+++ b/jstests/_runner_leak.js
@@ -0,0 +1,33 @@
+//
+// simple runner to run toplevel tests in jstests
+//
+var files = listFiles("jstests");
+
+db.runCommand( "closeAllDatabases" );
+
+prev = db.runCommand( "meminfo" );
+
+files.forEach(
+ function(x) {
+
+ if ( /_runner/.test(x.name) ||
+ /_lodeRunner/.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;
+ }
+);
+
+