summaryrefslogtreecommitdiff
path: root/jstests/dur
diff options
context:
space:
mode:
authorEliot Horowitz <eliot@10gen.com>2011-02-18 20:59:59 -0500
committerEliot Horowitz <eliot@10gen.com>2011-02-18 20:59:59 -0500
commit9e73768cebcf84ac89ca91d57bc731612ee286ff (patch)
tree25793d4fcbf738053bd334486a84b6fe16f9994d /jstests/dur
parentdcd5c777b7baa2c12636272372a8a1de669ad7c6 (diff)
downloadmongo-9e73768cebcf84ac89ca91d57bc731612ee286ff.tar.gz
formatting
Diffstat (limited to 'jstests/dur')
-rwxr-xr-xjstests/dur/manyRestart.js86
1 files changed, 43 insertions, 43 deletions
diff --git a/jstests/dur/manyRestart.js b/jstests/dur/manyRestart.js
index e54c3b3414c..956fd034224 100755
--- a/jstests/dur/manyRestart.js
+++ b/jstests/dur/manyRestart.js
@@ -5,23 +5,23 @@
var debugging = false;
var testname = "manyRestarts";
var step = 1;
-var conn = null;
-
-function checkNoJournalFiles(path, pass) {
- var files = listFiles(path);
- if (files.some(function (f) { return f.name.indexOf("prealloc") < 0; })) {
- if (pass == null) {
- // wait a bit longer for mongod to potentially finish if it is still running.
- sleep(10000);
- return checkNoJournalFiles(path, 1);
- }
- print("\n\n\n");
- print("FAIL path:" + path);
- print("unexpected files:");
- printjson(files);
- assert(false, "FAIL a journal/lsn file is present which is unexpected");
- }
-}
+var conn = null;
+
+function checkNoJournalFiles(path, pass) {
+ var files = listFiles(path);
+ if (files.some(function (f) { return f.name.indexOf("prealloc") < 0; })) {
+ if (pass == null) {
+ // wait a bit longer for mongod to potentially finish if it is still running.
+ sleep(10000);
+ return checkNoJournalFiles(path, 1);
+ }
+ print("\n\n\n");
+ print("FAIL path:" + path);
+ print("unexpected files:");
+ printjson(files);
+ assert(false, "FAIL a journal/lsn file is present which is unexpected");
+ }
+}
function runDiff(a, b) {
function reSlash(s) {
@@ -127,17 +127,17 @@ sleep(5000);
for (var i = 0; i < 3; ++i) {
-// durable version
-log("restarting 30001");
-conn = startMongodNoReset("--port", 30001, "--dbpath", path2, "--dur", "--smallfiles", "--durOptions", 8);
-
-verify();
-
-// kill the process hard
-log("hard kill");
-stopMongod(30001, /*signal*/9);
-
-sleep(5000);
+ // durable version
+ log("restarting 30001");
+ conn = startMongodNoReset("--port", 30001, "--dbpath", path2, "--dur", "--smallfiles", "--durOptions", 8);
+
+ verify();
+
+ // kill the process hard
+ log("hard kill");
+ stopMongod(30001, /*signal*/9);
+
+ sleep(5000);
}
// journal file should be present, and non-empty as we killed hard
@@ -152,7 +152,7 @@ stopMongod(30002);
sleep(5000);
// at this point, after clean shutdown, there should be no journal files
-log("check no journal files");
+log("check no journal files");
checkNoJournalFiles(path2 + "/journal");
log("check data matches ns");
@@ -168,20 +168,20 @@ log("check data matches done");
var nrows = 0;
for (var i = 0; i < 5; ++i) {
-// durable version
-log("restarting 30001");
-conn = startMongodNoReset("--port", 30001, "--dbpath", path2, "--dur", "--smallfiles", "--durOptions", 8);
-nrows += addRows();
-// wait for group commit.
-printjson(conn.getDB('admin').runCommand({getlasterror:1, fsync:1}));
-
-verifyRows(nrows);
-
-// kill the process hard
-log("hard kill");
-stopMongod(30001, /*signal*/9);
-
-sleep(5000);
+ // durable version
+ log("restarting 30001");
+ conn = startMongodNoReset("--port", 30001, "--dbpath", path2, "--dur", "--smallfiles", "--durOptions", 8);
+ nrows += addRows();
+ // wait for group commit.
+ printjson(conn.getDB('admin').runCommand({getlasterror:1, fsync:1}));
+
+ verifyRows(nrows);
+
+ // kill the process hard
+ log("hard kill");
+ stopMongod(30001, /*signal*/9);
+
+ sleep(5000);
}
print(testname + " SUCCESS");