summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdam Midvidy <amidvidy@gmail.com>2016-01-14 09:54:24 -0500
committerAdam Midvidy <amidvidy@gmail.com>2016-01-14 11:53:39 -0500
commit1fd3ccc79b31482afda983c0916f68e6b5adc0be (patch)
treec16575e1f8decc6c9d4a3a00b38db733851b9cf8
parent3fa4cdc79b04639061f0d13b68b60c3e3e5102b6 (diff)
downloadmongo-1fd3ccc79b31482afda983c0916f68e6b5adc0be.tar.gz
SERVER-21197 test fixes for lockFile changes
- check correct error message on Windows in lock_file_fail_to_open.js - set dbpath in unittests prior to calling createLockFile
-rw-r--r--jstests/noPassthrough/lock_file_fail_to_open.js5
-rw-r--r--src/mongo/db/repl/rs_rollback_test.cpp2
-rw-r--r--src/mongo/db/repl/sync_tail_test.cpp2
3 files changed, 5 insertions, 4 deletions
diff --git a/jstests/noPassthrough/lock_file_fail_to_open.js b/jstests/noPassthrough/lock_file_fail_to_open.js
index c20d7efdd1f..b5b356bb102 100644
--- a/jstests/noPassthrough/lock_file_fail_to_open.js
+++ b/jstests/noPassthrough/lock_file_fail_to_open.js
@@ -22,8 +22,9 @@
// We should have failed to start.
assert(mongo2 === null);
var logContents = rawMongoProgramOutput();
- assert(logContents.indexOf("Unable to lock file") > 0);
-
+ assert(logContents.indexOf("Unable to lock file") > 0 ||
+ // Windows error message is different.
+ logContents.indexOf("Unable to create/open lock file") > 0);
} finally {
MongoRunner.stopMongod(mongo1);
}
diff --git a/src/mongo/db/repl/rs_rollback_test.cpp b/src/mongo/db/repl/rs_rollback_test.cpp
index 7bb7d52e94d..04324090a15 100644
--- a/src/mongo/db/repl/rs_rollback_test.cpp
+++ b/src/mongo/db/repl/rs_rollback_test.cpp
@@ -143,7 +143,6 @@ private:
void RSRollbackTest::setUp() {
ServiceContext* serviceContext = getGlobalServiceContext();
if (!serviceContext->getGlobalStorageEngine()) {
- checked_cast<ServiceContextMongoD*>(getGlobalServiceContext())->createLockFile();
// When using the 'devnull' storage engine, it is fine for the temporary directory to
// go away after the global storage engine is initialized.
unittest::TempDir tempDir("rs_rollback_test");
@@ -151,6 +150,7 @@ void RSRollbackTest::setUp() {
mongo::storageGlobalParams.dbpath = tempDir.path();
mongo::storageGlobalParams.engine = "ephemeralForTest";
mongo::storageGlobalParams.engineSetByUser = true;
+ checked_cast<ServiceContextMongoD*>(getGlobalServiceContext())->createLockFile();
serviceContext->initializeGlobalStorageEngine();
}
diff --git a/src/mongo/db/repl/sync_tail_test.cpp b/src/mongo/db/repl/sync_tail_test.cpp
index 69ec17a0a90..39668fba794 100644
--- a/src/mongo/db/repl/sync_tail_test.cpp
+++ b/src/mongo/db/repl/sync_tail_test.cpp
@@ -86,13 +86,13 @@ private:
void SyncTailTest::setUp() {
ServiceContext* serviceContext = getGlobalServiceContext();
if (!serviceContext->getGlobalStorageEngine()) {
- checked_cast<ServiceContextMongoD*>(getGlobalServiceContext())->createLockFile();
// When using the 'devnull' storage engine, it is fine for the temporary directory to
// go away after the global storage engine is initialized.
unittest::TempDir tempDir("sync_tail_test");
mongo::storageGlobalParams.dbpath = tempDir.path();
mongo::storageGlobalParams.engine = "devnull";
mongo::storageGlobalParams.engineSetByUser = true;
+ checked_cast<ServiceContextMongoD*>(getGlobalServiceContext())->createLockFile();
serviceContext->initializeGlobalStorageEngine();
}
ReplSettings replSettings;