summaryrefslogtreecommitdiff
path: root/src/mongo/dbtests
diff options
context:
space:
mode:
authorMathias Stearn <mathias@10gen.com>2014-07-01 13:31:17 -0400
committerMathias Stearn <mathias@10gen.com>2014-07-09 12:57:12 -0400
commit46a25fdd1470fb08876c229e77be4986fd12082b (patch)
tree5db072e07fb6c0ee3f2c573b9abc1083f68aca08 /src/mongo/dbtests
parent4939ccc6ebb0f7a61121e77ceeebd75d8841606a (diff)
downloadmongo-46a25fdd1470fb08876c229e77be4986fd12082b.tar.gz
SERVER-14395 Clean up StorageEngine initialization and shutdown
* Added StorageEngine::cleanShutdown() and commented that the destructor will never be called. * MMapV1StorageEngine specific operations were pulled into its constructor and cleanShutdown implementation. * StorageEngines are now constructed at a point where it is safe to spawn threads.
Diffstat (limited to 'src/mongo/dbtests')
-rw-r--r--src/mongo/dbtests/framework.cpp14
1 files changed, 3 insertions, 11 deletions
diff --git a/src/mongo/dbtests/framework.cpp b/src/mongo/dbtests/framework.cpp
index 04f53dd4e96..062b6a7edca 100644
--- a/src/mongo/dbtests/framework.cpp
+++ b/src/mongo/dbtests/framework.cpp
@@ -40,14 +40,13 @@
#include "mongo/base/initializer.h"
#include "mongo/base/status.h"
#include "mongo/db/client.h"
-#include "mongo/db/storage/mmap_v1/dur.h"
#include "mongo/db/ops/update.h"
+#include "mongo/db/storage/storage_engine.h"
#include "mongo/dbtests/dbtests.h"
#include "mongo/dbtests/framework_options.h"
#include "mongo/util/background.h"
#include "mongo/util/concurrency/mutex.h"
#include "mongo/util/exit.h"
-#include "mongo/util/file_allocator.h"
#include "mongo/util/version_reporting.h"
namespace moe = mongo::optionenvironment;
@@ -103,31 +102,24 @@ namespace mongo {
frameworkGlobalParams.runsPerTest = 1;
Client::initThread("testsuite");
- acquirePathLock();
srand( (unsigned) frameworkGlobalParams.seed );
printGitVersion();
printOpenSSLVersion();
printSysInfo();
- FileAllocator::get()->start();
-
- dur::startup();
+ initGlobalStorageEngine();
TestWatchDog twd;
twd.go();
-
int ret = ::mongo::unittest::Suite::run(frameworkGlobalParams.suites,
frameworkGlobalParams.filter,
frameworkGlobalParams.runsPerTest);
-#if !defined(_WIN32) && !defined(__sunos__)
- flock( lockFile, LOCK_UN );
-#endif
cc().shutdown();
- dbexit( (ExitCode)ret ); // so everything shuts down cleanly
+ exitCleanly( (ExitCode)ret ); // so everything shuts down cleanly
return ret;
}
} // namespace dbtests