Skip to content

Commit

Permalink
Merge branch 'main' into kpr7
Browse files Browse the repository at this point in the history
  • Loading branch information
kostasrim committed Jan 17, 2025
2 parents 36273d0 + 6f0072e commit e802e6e
Show file tree
Hide file tree
Showing 19 changed files with 1,101 additions and 951 deletions.
6 changes: 5 additions & 1 deletion .github/workflows/test-fakeredis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,11 @@ jobs:
working-directory: tests/fakeredis
run: |
poetry run pytest test/ \
--ignore test/test_hypothesis.py \
--ignore test/test_hypothesis/test_hash.py \
--ignore test/test_hypothesis/test_set.py \
--ignore test/test_hypothesis/test_zset.py \
--ignore test/test_hypothesis/test_joint.py \
--ignore test/test_hypothesis/test_transaction.py \
--ignore test/test_mixins/test_bitmap_commands.py \
--junit-xml=results-tests.xml --html=report-tests.html -v
continue-on-error: true # For now to mark the flow as successful
Expand Down
3 changes: 3 additions & 0 deletions src/server/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,9 @@ endif()
add_library(dfly_test_lib test_utils.cc)
cxx_link(dfly_test_lib dragonfly_lib facade_test gtest_main_ext)

if (WITH_ASAN OR WITH_USAN)
target_compile_definitions(dfly_test_lib PRIVATE SANITIZERS)
endif()

cxx_test(dragonfly_test dfly_test_lib LABELS DFLY)
cxx_test(multi_test dfly_test_lib LABELS DFLY)
Expand Down
8 changes: 0 additions & 8 deletions src/server/rdb_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -42,14 +42,6 @@ class RdbTest : public BaseFamilyTest {
protected:
void SetUp();

static void SetUpTestSuite() {
static bool init = true;
if (exchange(init, false)) {
fb2::SetDefaultStackResource(&fb2::std_malloc_resource, 32_KB);
}
BaseFamilyTest::SetUpTestSuite();
}

io::FileSource GetSource(string name);

std::error_code LoadRdb(const string& filename) {
Expand Down
23 changes: 23 additions & 0 deletions src/server/test_utils.cc
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,23 @@ ABSL_FLAG(bool, force_epoll, false, "If true, uses epoll api instead iouring to
ABSL_DECLARE_FLAG(uint32_t, acllog_max_len);
namespace dfly {

namespace {

// Default stack size for fibers. We decrease it by 16 bytes because some allocators
// need additional 8-16 bytes for their internal structures, thus over reserving additional
// memory pages if using round sizes.
#ifdef NDEBUG
constexpr size_t kFiberDefaultStackSize = 32_KB - 16;
#elif defined SANITIZERS
// Increase stack size for sanitizers builds.
constexpr size_t kFiberDefaultStackSize = 64_KB - 16;
#else
// Increase stack size for debug builds.
constexpr size_t kFiberDefaultStackSize = 50_KB - 16;
#endif

} // namespace

std::ostream& operator<<(std::ostream& os, const DbStats& stats) {
os << "keycount: " << stats.key_count << ", tiered_size: " << stats.tiered_used_bytes
<< ", tiered_entries: " << stats.tiered_entries << "\n";
Expand Down Expand Up @@ -168,6 +185,12 @@ void BaseFamilyTest::SetUpTestSuite() {

absl::SetFlag(&FLAGS_rss_oom_deny_ratio, -1);
absl::SetFlag(&FLAGS_dbfilename, "");

static bool init = true;
if (exchange(init, false)) {
fb2::SetDefaultStackResource(&fb2::std_malloc_resource, kFiberDefaultStackSize);
}

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.
Expand Down
232 changes: 132 additions & 100 deletions tests/fakeredis/poetry.lock

Large diffs are not rendered by default.

Loading

0 comments on commit e802e6e

Please sign in to comment.