feat(rdb save): add unit test to save df with all compression levels (#517)

feat(rdb save): add unit test to save df with all comression levels

Signed-off-by: adi_holden <adi@dragonflydb.io>
This commit is contained in:
adiholden 2022-11-29 15:14:43 +02:00 committed by GitHub
parent 685b4411e8
commit cf2ba8eb84
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 16 additions and 1 deletions

View file

@ -30,6 +30,7 @@ using absl::StrCat;
ABSL_DECLARE_FLAG(int32, list_compress_depth);
ABSL_DECLARE_FLAG(int32, list_max_listpack_size);
ABSL_DECLARE_FLAG(int, compression_mode);
namespace dfly {
@ -144,6 +145,20 @@ TEST_F(RdbTest, Stream) {
Run({"save"});
}
TEST_F(RdbTest, ComressionModeSaveDragonflyAndReload) {
Run({"debug", "populate", "500000"});
for (int i = 0; i <= 2; ++i) {
SetFlag(&FLAGS_compression_mode, i);
RespExpr resp = Run({"save", "df"});
ASSERT_EQ(resp, "OK");
auto save_info = service_->server_family().GetLastSaveInfo();
resp = Run({"debug", "load", save_info->file_name});
ASSERT_EQ(resp, "OK");
}
}
TEST_F(RdbTest, Reload) {
absl::FlagSaver fs;