1
0
Fork 0
mirror of https://github.com/dragonflydb/dragonfly.git synced 2024-12-15 17:51:06 +00:00

test(server): Run all unit tests with --force_epoll (#1672)

This commit is contained in:
Shahar Mike 2023-08-09 11:00:46 +03:00 committed by GitHub
parent db3721b6e2
commit 3779837c5f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 19 additions and 1 deletions

View file

@ -97,6 +97,9 @@ jobs:
#GLOG_logtostderr=1 GLOG_vmodule=transaction=1,engine_shard_set=1
GLOG_logtostderr=1 GLOG_vmodule=rdb_load=1,rdb_save=1,snapshot=1 ctest -V -L DFLY
echo "Running tests with --force_epoll"
FLAGS_force_epoll=true ctest -V -L DFLY
echo "Running tests with --cluster_mode=emulated"
FLAGS_cluster_mode=emulated ctest -V -L DFLY

View file

@ -577,6 +577,10 @@ TEST_F(DflyEngineTest, Issue742) {
}
TEST_F(DefragDflyEngineTest, TestDefragOption) {
if (pp_->GetNextProactor()->GetKind() == util::ProactorBase::EPOLL) {
GTEST_SKIP() << "Defragmentation via idle task is only supported in io uring";
}
absl::SetFlag(&FLAGS_mem_defrag_threshold, 0.02);
// Fill data into dragonfly and then check if we have
// any location in memory to defrag. See issue #448 for details about this.

View file

@ -127,7 +127,11 @@ void BaseFamilyTest::SetUpTestSuite() {
init_zmalloc_threadlocal(mi_heap_get_backing());
// TODO: go over all env variables starting with FLAGS_ and make sure they are in the below list.
static constexpr const char* kEnvFlags[] = {"cluster_mode", "lock_on_hashtags"};
static constexpr const char* kEnvFlags[] = {
"cluster_mode",
"lock_on_hashtags",
"force_epoll",
};
for (string_view flag : kEnvFlags) {
const char* value = getenv(absl::StrCat("FLAGS_", flag).data());
if (value != nullptr) {

View file

@ -32,6 +32,13 @@ class TieredStorageTest : public BaseFamilyTest {
void TieredStorageTest::SetUpTestSuite() {
BaseFamilyTest::SetUpTestSuite();
SetFlag(&FLAGS_spill_file_prefix, "/tmp/spill");
auto* force_epoll = absl::FindCommandLineFlag("force_epoll");
if (force_epoll->CurrentValue() == "true") {
LOG(WARNING) << "Tiered storage only works with io uring, skipping tests.";
// Exiting directly, as otherwise EngineShardSet will exit with error status.
exit(0);
}
}
void TieredStorageTest::FillExternalKeys(unsigned count) {