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:
parent
587660f7f5
commit
60fb9feec8
1 changed files with 5 additions and 4 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue