diff options
author | Eliot Horowitz <eliot@10gen.com> | 2011-07-19 01:44:33 -0400 |
---|---|---|
committer | Eliot Horowitz <eliot@10gen.com> | 2011-07-19 02:02:12 -0400 |
commit | b9270b6e5e103613aee015e72d278ef6cd79140e (patch) | |
tree | 71e23a9c1986e4c9d88dd23ab7c3757fcfcb1e1c /jstests/profile1.js | |
parent | d69d4be02e19beb491bb94b3e9876c175613a399 (diff) | |
download | mongo-b9270b6e5e103613aee015e72d278ef6cd79140e.tar.gz |
make tests more robust and add debugging
Diffstat (limited to 'jstests/profile1.js')
-rw-r--r-- | jstests/profile1.js | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/jstests/profile1.js b/jstests/profile1.js index d7f1666d840..eed64f60ae2 100644 --- a/jstests/profile1.js +++ b/jstests/profile1.js @@ -1,6 +1,14 @@ try { + function getProfileAString() { + var s = "\n"; + db.system.profile.find().forEach( function(z){ + s += tojson( z ) + " ,\n" ; + } ); + return s; + } + /* With pre-created system.profile (capped) */ db.runCommand({profile: 0}); db.getCollection("system.profile").drop(); @@ -58,14 +66,14 @@ try { db.eval( "sleep(25)" ) db.eval( "sleep(120)" ) after = db.system.profile.count() - assert.eq( before + 1 , after , "X2" ) + assert.eq( before + 1 , after , "X2 : " + getProfileAString() ) db.setProfilingLevel(1,20); before = db.system.profile.count(); db.eval( "sleep(25)" ) db.eval( "sleep(120)" ) after = db.system.profile.count() - assert.eq( before + 2 , after , "X3" ) + assert.eq( before + 2 , after , "X3 : " + getProfileAString() ) db.profile.drop(); @@ -79,7 +87,6 @@ try { assert.eq( "update" , r.op , "Y3" ); assert.eq( "test.profile1" , r.ns , "Y4" ); - } finally { // disable profiling for subsequent tests assert.commandWorked( db.runCommand( {profile:0} ) ); |