1
0
Fork 0

potentially fix failing Windows catch test (#7080)

This commit is contained in:
Jan 2018-10-26 10:11:02 +02:00 committed by GitHub
parent 5db8528beb
commit b0bff0a7da
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 5 deletions

View File

@ -82,11 +82,11 @@ ClusterEngine::ClusterEngine(application_features::ApplicationServer& server)
ClusterEngine::~ClusterEngine() { } ClusterEngine::~ClusterEngine() { }
bool ClusterEngine::isRocksDB() const { bool ClusterEngine::isRocksDB() const {
return _actualEngine && _actualEngine->name() == RocksDBEngine::FeatureName; return !ClusterEngine::Mocking && _actualEngine && _actualEngine->name() == RocksDBEngine::FeatureName;
} }
bool ClusterEngine::isMMFiles() const { bool ClusterEngine::isMMFiles() const {
return _actualEngine && _actualEngine->name() == MMFilesEngine::FeatureName; return !ClusterEngine::Mocking && _actualEngine && _actualEngine->name() == MMFilesEngine::FeatureName;
} }
bool ClusterEngine::isMock() const { bool ClusterEngine::isMock() const {
@ -94,18 +94,19 @@ bool ClusterEngine::isMock() const {
} }
ClusterEngineType ClusterEngine::engineType() const { ClusterEngineType ClusterEngine::engineType() const {
if (isMock()) {
return ClusterEngineType::MockEngine;
}
TRI_ASSERT(_actualEngine != nullptr); TRI_ASSERT(_actualEngine != nullptr);
if (isMMFiles()) { if (isMMFiles()) {
return ClusterEngineType::MMFilesEngine; return ClusterEngineType::MMFilesEngine;
} else if (isRocksDB()) { } else if (isRocksDB()) {
return ClusterEngineType::RocksDBEngine; return ClusterEngineType::RocksDBEngine;
} else if (isMock()) {
return ClusterEngineType::MockEngine;
} }
TRI_ASSERT(false); TRI_ASSERT(false);
THROW_ARANGO_EXCEPTION(TRI_ERROR_INTERNAL); THROW_ARANGO_EXCEPTION_MESSAGE(TRI_ERROR_INTERNAL, "invalid engine type");
} }
// inherited from ApplicationFeature // inherited from ApplicationFeature
@ -390,6 +391,7 @@ void ClusterEngine::addOptimizerRules() {
} else if (engineType() == ClusterEngineType::RocksDBEngine) { } else if (engineType() == ClusterEngineType::RocksDBEngine) {
RocksDBOptimizerRules::registerResources(); RocksDBOptimizerRules::registerResources();
} else if (engineType() != ClusterEngineType::MockEngine) { } else if (engineType() != ClusterEngineType::MockEngine) {
// invalid engine type...
TRI_ASSERT(false); TRI_ASSERT(false);
} }
} }

View File

@ -32,6 +32,7 @@
#include "Aql/ExpressionContext.h" #include "Aql/ExpressionContext.h"
#include "Aql/Ast.h" #include "Aql/Ast.h"
#include "ClusterEngine/ClusterEngine.h" #include "ClusterEngine/ClusterEngine.h"
#include "Random/RandomGenerator.h"
#include "Basics/files.h" #include "Basics/files.h"
#include "RestServer/DatabasePathFeature.h" #include "RestServer/DatabasePathFeature.h"
#include "V8/v8-utils.h" #include "V8/v8-utils.h"
@ -132,6 +133,7 @@ namespace tests {
void init(bool withICU /*= false*/) { void init(bool withICU /*= false*/) {
arangodb::transaction::Methods::clearDataSourceRegistrationCallbacks(); arangodb::transaction::Methods::clearDataSourceRegistrationCallbacks();
ClusterEngine::Mocking = true; ClusterEngine::Mocking = true;
arangodb::RandomGenerator::initialize(arangodb::RandomGenerator::RandomType::MERSENNE);
} }
// @Note: once V8 is initialized all 'CATCH' errors will result in SIGILL // @Note: once V8 is initialized all 'CATCH' errors will result in SIGILL