8000 potentially fix failing Windows catch test (#7079) · sita1999/arangodb@78af18d · GitHub
[go: up one dir, main page]

Skip to content

Commit 78af18d

Browse files
authored
potentially fix failing Windows catch test (arangodb#7079)
* potentially fix failing Windows catch test * added lines suggested by @KVS85
1 parent 4a32fcd commit 78af18d

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

arangod/ClusterEngine/ClusterEngine.cpp

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -82,30 +82,31 @@ ClusterEngine::ClusterEngine(application_features::ApplicationServer& server)
8282
ClusterEngine::~ClusterEngine() { }
8383

8484
bool ClusterEngine::isRocksDB() const {
85-
return _actualEngine && _actualEngine->name() == RocksDBEngine::FeatureName;
85+
return !ClusterEngine::Mocking && _actualEngine && _actualEngine->name() == RocksDBEngine::FeatureName;
8686
}
8787

8888
bool ClusterEngine::isMMFiles() const {
89-
return _actualEngine && _actualEngine->name() == MMFilesEngine::FeatureName;
89+
return !ClusterEngine::Mocking && _actualEngine && _actualEngine->name() == MMFilesEngine::FeatureName;
9090
}
9191

9292
bool ClusterEngine::isMock() const {
9393
return ClusterEngine::Mocking || (_actualEngine && _actualEngine->name() == "Mock");
9494
}
9595

9696
ClusterEngineType ClusterEngine::engineType() const {
97+
if (isMock()) {
98+
return ClusterEngineType::MockEngine;
99+
}
97100
TRI_ASSERT(_actualEngine != nullptr);
98101

99102
if (isMMFiles()) {
100103
return ClusterEngineType::MMFilesEngine;
101104
} else if (isRocksDB()) {
102105
return ClusterEngineType::RocksDBEngine;
103-
} else if (isMock()) {
104-
return ClusterEngineType::MockEngine;
105106
}
106107

107108
TRI_ASSERT(false);
108-
THROW_ARANGO_EXCEPTION(TRI_ERROR_INTERNAL);
109+
THROW_ARANGO_EXCEPTION_MESSAGE(TRI_ERROR_INTERNAL, "invalid engine type");
109110
}
110111

111112
// inherited from ApplicationFeature
@@ -390,6 +391,7 @@ void ClusterEngine::addOptimizerRules() {
390391
} else if (engineType() == ClusterEngineType::RocksDBEngine) {
391392
RocksDBOptimizerRules::registerResources();
392393
} else if (engineType() != ClusterEngineType::MockEngine) {
394+
// invalid engine type...
393395
TRI_ASSERT(false);
394396
}
395397
}

tests/IResearch/common.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
#include "Aql/ExpressionContext.h"
3333
#include "Aql/Ast.h"
3434
#include "ClusterEngine/ClusterEngine.h"
35+
#include "Random/RandomGenerator.h"
3536
#include "Basics/files.h"
3637
#include "RestServer/DatabasePathFeature.h"
3738
#include "V8/v8-utils.h"
@@ -132,6 +133,7 @@ namespace tests {
132133
void init(bool withICU /*= false*/) {
133134
arangodb::transaction::Methods::clearDataSourceRegistrationCallbacks();
134135
ClusterEngine::Mocking = true;
136+
arangodb::RandomGenerator::initialize(arangodb::RandomGenerator::RandomType::MERSENNE);
135137
}
136138

137139
// @Note: once V8 is initialized all 'CATCH' errors will result in SIGILL

0 commit comments

Comments
 (0)
0