From 2173d54bd0440831c1378fd82ebb252abb7b01ce Mon Sep 17 00:00:00 2001 From: dwight Date: Mon, 7 Feb 2011 12:22:32 -0500 Subject: crlf --- jstests/dur/dropdb.js | 68 +++++++++++++++++++++++++-------------------------- 1 file changed, 34 insertions(+), 34 deletions(-) (limited to 'jstests') diff --git a/jstests/dur/dropdb.js b/jstests/dur/dropdb.js index 8e1aeffb2b6..72e02517aa2 100644 --- a/jstests/dur/dropdb.js +++ b/jstests/dur/dropdb.js @@ -4,23 +4,23 @@ var debugging = false; var testname = "dropdb"; 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) { @@ -64,18 +64,18 @@ function work() { d.foo.insert({ _id: 100 }); - // assure writes applied in case we kill -9 on return from this function + // assure writes applied in case we kill -9 on return from this function assert(d.runCommand({ getlasterror: 1, fsync: 1 }).ok, "getlasterror not ok"); } function verify() { - log("verify"); - var d = conn.getDB("test"); - var count = d.foo.count(); - if (count != 1) { - sleep(5000); // easier to read then - print("\n\n\ndropdb.js FAIL test.foo.count() should be 1 but is : " + count + "\n\n\n"); - assert(false); + log("verify"); + var d = conn.getDB("test"); + var count = d.foo.count(); + if (count != 1) { + sleep(5000); // easier to read then + print("\n\n\ndropdb.js FAIL test.foo.count() should be 1 but is : " + count + "\n\n\n"); + assert(false); } assert(d.foo.findOne()._id == 100, "100"); @@ -112,26 +112,26 @@ stopMongod(30000); log("mongod dur"); conn = startMongodEmpty("--port", 30001, "--dbpath", path2, "--dur", "--smallfiles", "--durOptions", 8); work(); -verify(); - -// kill the process hard +verify(); + +// kill the process hard log("kill 9"); stopMongod(30001, /*signal*/9); // journal file should be present, and non-empty as we killed hard -log("restart and recover"); -conn = startMongodNoReset("--port", 30002, "--dbpath", path2, "--dur", "--smallfiles", "--durOptions", 9); - +log("restart and recover"); +conn = startMongodNoReset("--port", 30002, "--dbpath", path2, "--dur", "--smallfiles", "--durOptions", 9); + log("verify after recovery"); verify(); -log("stop mongod 30002"); -stopMongod(30002); +log("stop mongod 30002"); +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"); -- cgit v1.2.1