summaryrefslogtreecommitdiff
path: root/jstests/dur
diff options
context:
space:
mode:
authorDwight <dwight@10gen.com>2011-03-17 12:22:08 -0400
committerDwight <dwight@10gen.com>2011-03-17 12:22:40 -0400
commitfc829317a160ed04a67011003ceda5e6671f6cc8 (patch)
treecc82546946525667095133c3780ee7c89ec60cdb /jstests/dur
parent9f8f03d75c733d2c80bf5b1076eea6fc9f9d65a6 (diff)
downloadmongo-fc829317a160ed04a67011003ceda5e6671f6cc8.tar.gz
better logging
Diffstat (limited to 'jstests/dur')
-rwxr-xr-xjstests/dur/dur1.js21
1 files changed, 11 insertions, 10 deletions
diff --git a/jstests/dur/dur1.js b/jstests/dur/dur1.js
index c8b73d8f186..299ac3020ed 100755
--- a/jstests/dur/dur1.js
+++ b/jstests/dur/dur1.js
@@ -75,7 +75,7 @@ function work() {
}
function verify() {
- log("verify");
+ log("verify test.foo.count == 2");
var d = conn.getDB("test");
var ct = d.foo.count();
if (ct != 2) {
@@ -99,37 +99,38 @@ var path1 = "/data/db/" + testname+"nodur";
var path2 = "/data/db/" + testname+"dur";
// non-durable version
-log();
+log("run mongod without journaling");
conn = startMongodEmpty("--port", 30000, "--dbpath", path1, "--nodur", "--smallfiles");
work();
stopMongod(30000);
// durable version
-log();
+log("run mongod with --journal");
conn = startMongodEmpty("--port", 30001, "--dbpath", path2, "--journal", "--smallfiles", "--journalOptions", 8);
work();
// wait for group commit.
-printjson(conn.getDB('admin').runCommand({getlasterror:1, fsync:1}));
-
-// kill the process hard
+printjson(conn.getDB('admin').runCommand({getlasterror:1, fsync:1}));
+
+// kill the process hard
+log("kill 9");
stopMongod(30001, /*signal*/9);
// journal file should be present, and non-empty as we killed hard
// restart and recover
-log();
+log("restart mongod --journal and recover");
conn = startMongodNoReset("--port", 30002, "--dbpath", path2, "--journal", "--smallfiles", "--journalOptions", 8);
verify();
-log("stop");
+log("stop mongod");
stopMongod(30002);
// stopMongod seems to be asynchronous (hmmm) so we sleep here.
-sleep(5000);
+// sleep(5000);
// at this point, after clean shutdown, there should be no journal files
-log("check no journal files");
+log("check no journal files (after presumably clean shutdown)");
checkNoJournalFiles(path2 + "/journal");
log("check data matches ns");