Add probe::assert::rocksDB code probe annotation

This commit is contained in:
sfc-gh-tclinkenbeard 2022-09-15 11:48:04 -07:00
parent b19f1b5e3b
commit c0fd93869c
3 changed files with 15 additions and 2 deletions

View File

@ -1461,7 +1461,7 @@ void SimulationConfig::setStorageEngine(const TestConfig& testConfig) {
break;
}
case 4: {
CODE_PROBE(true, "Simulated cluster using RocksDB storage engine");
CODE_PROBE(true, "Simulated cluster using RocksDB storage engine", probe::assert::rocksDB);
set_config("ssd-rocksdb-v1");
// Tests using the RocksDB engine are necessarily non-deterministic because of RocksDB
// background threads.
@ -1471,7 +1471,7 @@ void SimulationConfig::setStorageEngine(const TestConfig& testConfig) {
break;
}
case 5: {
CODE_PROBE(true, "Simulated cluster using Sharded RocksDB storage engine");
CODE_PROBE(true, "Simulated cluster using Sharded RocksDB storage engine", probe::assert::rocksDB);
set_config("ssd-sharded-rocksdb");
// Tests using the RocksDB engine are necessarily non-deterministic because of RocksDB
// background threads.

View File

@ -288,6 +288,14 @@ bool SimOnly::operator()(ICodeProbe* self) const {
return g_network->isSimulated();
}
bool RocksDB::operator()(ICodeProbe* self) const {
#ifdef SSD_ROCKSDB_EXPERIMENTAL
return true;
#else
return false;
#endif
}
} // namespace assert
} // namespace probe

View File

@ -70,6 +70,10 @@ struct SimOnly {
constexpr static AnnotationType type = AnnotationType::Assertion;
bool operator()(ICodeProbe* self) const;
};
struct RocksDB {
constexpr static AnnotationType type = AnnotationType::Assertion;
bool operator()(ICodeProbe* self) const;
};
template <class Left, class Right>
struct AssertOr {
@ -111,6 +115,7 @@ constexpr std::enable_if_t<T::type == AnnotationType::Assertion, AssertNot<T>> o
constexpr SimOnly simOnly;
constexpr auto noSim = !simOnly;
constexpr RocksDB rocksDB;
} // namespace assert