Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(test): fix rdb random fail on OOM #4509

Merged
merged 2 commits into from
Jan 27, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions src/server/rdb_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,10 @@ class RdbTest : public BaseFamilyTest {
};

void RdbTest::SetUp() {
// Setting max_memory_limit must be before calling InitWithDbFilename
max_memory_limit = 40000000;
InitWithDbFilename();
CHECK_EQ(zmalloc_used_memory_tl, 0);
max_memory_limit = 40000000;
}

inline const uint8_t* to_byte(const void* s) {
Expand Down Expand Up @@ -458,8 +459,8 @@ TEST_F(RdbTest, JsonTest) {
class HllRdbTest : public RdbTest, public testing::WithParamInterface<string> {};

TEST_P(HllRdbTest, Hll) {
LOG(ERROR) << " max memory: " << max_memory_limit
<< " used_mem_current: " << used_mem_current.load();
LOG(INFO) << " max memory: " << max_memory_limit
<< " used_mem_current: " << used_mem_current.load();
auto ec = LoadRdb("hll.rdb");

ASSERT_FALSE(ec) << ec.message();
Expand Down
Loading