Skip to content

Commit

Permalink
test: add ClusterEvalCrossslot (#4587)
Browse files Browse the repository at this point in the history
  • Loading branch information
BorysTheDev authored Feb 10, 2025
1 parent 8eb5e24 commit a56b129
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/server/cluster/cluster_family_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -480,6 +480,21 @@ TEST_F(ClusterFamilyTest, ClusterSlotsPopulate) {
}
}

TEST_F(ClusterFamilyTest, ClusterEvalCrossslot) {
ConfigSingleNodeCluster(GetMyId());

auto res = Run({"EVAL", "return redis.call('MSET', 'x1', 'x1', 'x2', 'x2', 'x3', 'x3');", "3",
"x1", "x2", "x3"});

EXPECT_THAT(res, ErrArg("CROSSSLOT"));

auto sha =
Run({"SCRPIT", "LOAD", "return redis.call('MSET', 'x1', 'x1', 'x2', 'x2', 'x3', 'x3');", "3",
"x1", "x2", "x3"});

EXPECT_THAT(Run({"EVALSHA", sha.GetString(), "3", "x1", "x2", "x3"}), ErrArg("CROSSSLOT"));
}

TEST_F(ClusterFamilyTest, ClusterConfigDeleteSlots) {
ConfigSingleNodeCluster(GetMyId());

Expand Down

0 comments on commit a56b129

Please sign in to comment.