1
0
Fork 0
mirror of https://github.com/dragonflydb/dragonfly.git synced 2024-12-14 11:58:02 +00:00

fix(tests): Fix flaky cluster test (#2158)

Fixes flaky cluster family test
This commit is contained in:
Vladislav 2023-11-10 18:31:57 +03:00 committed by GitHub
parent 587660f7f5
commit 60fb9feec8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -623,7 +623,7 @@ TEST_F(ClusterFamilyTest, ClusterConfigDeleteSomeSlots) {
"slot_ranges": [
{
"start": 0,
"end": 8000
"end": $1
}
],
"master": {
@ -636,7 +636,7 @@ TEST_F(ClusterFamilyTest, ClusterConfigDeleteSomeSlots) {
{
"slot_ranges": [
{
"start": 8001,
"start": $2,
"end": 16383
}
],
@ -648,7 +648,8 @@ TEST_F(ClusterFamilyTest, ClusterConfigDeleteSomeSlots) {
"replicas": []
}
])json";
string config = absl::Substitute(config_template, GetMyId());
string config = absl::Substitute(config_template, GetMyId(), "8000", "8001");
EXPECT_EQ(RunPrivileged({"dflycluster", "config", config}), "OK");
@ -662,7 +663,7 @@ TEST_F(ClusterFamilyTest, ClusterConfigDeleteSomeSlots) {
EXPECT_THAT(Run({"dbsize"}), IntArg(3));
// Move ownership over 8000 to other master
config = absl::StrReplaceAll(config, {{"8000", "7999"}, {"8001", "8000"}});
config = absl::Substitute(config_template, GetMyId(), "7999", "8000");
EXPECT_EQ(RunPrivileged({"dflycluster", "config", config}), "OK");
// Verify that keys for slot 8000 were deleted, while key for slot 7999 was kept