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

fix rdb test random fail on OOM

Signed-off-by: adi_holden <adi@dragonflydb.io>
This commit is contained in:
adiholden 2025-01-27 11:59:04 +02:00 committed by GitHub
parent e5da019419
commit d88bdb8bc3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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) {
@ -458,7 +459,7 @@ TEST_F(RdbTest, JsonTest) {
class HllRdbTest : public RdbTest, public testing::WithParamInterface<string> {};
TEST_P(HllRdbTest, Hll) {
LOG(ERROR) << " max memory: " << max_memory_limit
LOG(INFO) << " max memory: " << max_memory_limit
<< " used_mem_current: " << used_mem_current.load();
auto ec = LoadRdb("hll.rdb");