summaryrefslogtreecommitdiff
path: root/jstests/profile1.js
diff options
context:
space:
mode:
authorAaron <aaron@10gen.com>2010-12-28 14:29:26 -0800
committerAaron <aaron@10gen.com>2010-12-28 14:30:35 -0800
commit7d4bc0093f97215d235272116fa937751470c842 (patch)
tree41471cb5241e6daf42fc56e07a69504c37a720d9 /jstests/profile1.js
parentef7a5a2ef8ad36bd040502d968bffa398652d8e3 (diff)
downloadmongo-7d4bc0093f97215d235272116fa937751470c842.tar.gz
ensure profile1 test disables profiling when finished
Diffstat (limited to 'jstests/profile1.js')
-rw-r--r--jstests/profile1.js7
1 files changed, 7 insertions, 0 deletions
diff --git a/jstests/profile1.js b/jstests/profile1.js
index 49f6838c3b0..0e8009a7e04 100644
--- a/jstests/profile1.js
+++ b/jstests/profile1.js
@@ -1,4 +1,6 @@
+try {
+
/* With pre-created system.profile (capped) */
db.runCommand({profile: 0});
db.getCollection("system.profile").drop();
@@ -40,3 +42,8 @@ assert.eq(2, db.runCommand({profile: -1}).was, "I");
assert.eq(1, db.system.profile.stats().capped, "J");
var auto_size = db.system.profile.storageSize();
assert.gt(auto_size, capped_size, "K");
+
+} finally {
+ // disable profiling for subsequent tests
+ assert.commandWorked( db.runCommand( {profile:0} ) );
+} \ No newline at end of file