diff options
Diffstat (limited to 'jstests/noPassthrough/lock_file_fail_to_open.js')
-rw-r--r-- | jstests/noPassthrough/lock_file_fail_to_open.js | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/jstests/noPassthrough/lock_file_fail_to_open.js b/jstests/noPassthrough/lock_file_fail_to_open.js index 59d5fadbb5f..a53c6688b9f 100644 --- a/jstests/noPassthrough/lock_file_fail_to_open.js +++ b/jstests/noPassthrough/lock_file_fail_to_open.js @@ -1,27 +1,27 @@ // Tests that MongoD fails to start with the correct error message if mongod.lock exists in the // dbpath. (function() { - "use strict"; +"use strict"; - var baseName = "jstests_lock_file_fail_to_open"; +var baseName = "jstests_lock_file_fail_to_open"; - var dbPath = MongoRunner.dataPath + baseName + "/"; +var dbPath = MongoRunner.dataPath + baseName + "/"; - // Start a MongoD just to get a lockfile in place. - var mongo1 = MongoRunner.runMongod({dbpath: dbPath, waitForConnect: true}); +// Start a MongoD just to get a lockfile in place. +var mongo1 = MongoRunner.runMongod({dbpath: dbPath, waitForConnect: true}); - clearRawMongoProgramOutput(); - // Start another one which should fail to start as there is already a lockfile in its - // dbpath. - var mongo2 = null; - mongo2 = MongoRunner.runMongod({dbpath: dbPath, noCleanData: true}); - // We should have failed to start. - assert(mongo2 === null); +clearRawMongoProgramOutput(); +// Start another one which should fail to start as there is already a lockfile in its +// dbpath. +var mongo2 = null; +mongo2 = MongoRunner.runMongod({dbpath: dbPath, noCleanData: true}); +// We should have failed to start. +assert(mongo2 === null); - var logContents = rawMongoProgramOutput(); - assert(logContents.indexOf("Unable to lock the lock file") > 0 || - // Windows error message is different. - logContents.indexOf("Unable to create/open the lock file") > 0); +var logContents = rawMongoProgramOutput(); +assert(logContents.indexOf("Unable to lock the lock file") > 0 || + // Windows error message is different. + logContents.indexOf("Unable to create/open the lock file") > 0); - MongoRunner.stopMongod(mongo1); +MongoRunner.stopMongod(mongo1); })(); |