fix(tests): check cluster big snapshot in unit test (#4403)

fix tests: check cluster big snapshot in unit test

Signed-off-by: adi_holden <adi@dragonflydb.io>
This commit is contained in:
adiholden 2025-01-05 13:18:13 +02:00 committed by GitHub
parent 4f09fe036c
commit 92c3749c8c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 12 additions and 59 deletions

View file

@ -619,6 +619,18 @@ TEST_F(ClusterFamilyTest, ClusterFirstConfigCallDropsEntriesNotOwnedByNode) {
ExpectConditionWithinTimeout([&]() { return CheckedInt({"dbsize"}) == 0; });
}
TEST_F(ClusterFamilyTest, SnapshotBiggerThanMaxMemory) {
InitWithDbFilename();
ConfigSingleNodeCluster(GetMyId());
Run({"debug", "populate", "50000"});
EXPECT_EQ(Run({"save", "df"}), "OK");
max_memory_limit = 10000;
auto save_info = service_->server_family().GetLastSaveInfo();
EXPECT_EQ(Run({"dfly", "load", save_info.file_name}), "OK");
}
TEST_F(ClusterFamilyTest, Keyslot) {
// Example from Redis' command reference: https://redis.io/commands/cluster-keyslot/
EXPECT_THAT(Run({"cluster", "keyslot", "somekey"}), IntArg(11'058));