Skip to content

Commit 40a7f03

Browse files
Fix test
1 parent b835447 commit 40a7f03

File tree

1 file changed

+12
-7
lines changed

1 file changed

+12
-7
lines changed

t/plugin/limit-req-redis-cluster.t

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -610,14 +610,19 @@ qr/property \"rate\" validation failed: expected 0 to be greater than 0/
610610
--- config
611611
location /t {
612612
content_by_lua_block {
613-
local redis_cluster = require "resty.rediscluster"
614-
local red_c = redis_cluster:new({
615-
name = "test",
616-
serv_list = {
617-
{ ip = "127.0.0.1", port = 5000 },
618-
{ ip = "127.0.0.1", port = 5002 }
613+
local redis_cluster = require("apisix.utils.rediscluster")
614+
local conf = {
615+
redis_cluster_name = "test",
616+
redis_cluster_nodes = {
617+
"127.0.0.1:5000",
618+
"127.0.0.1:5002"
619619
}
620-
}, "plugin-limit-req-redis-cluster-slot-lock")
620+
}
621+
local red_c, err = redis_cluster.new(conf, "plugin-limit-req-redis-cluster-slot-lock")
622+
if not red_c then
623+
ngx.say("Failed to create Redis cluster client: ", err)
624+
return
625+
end
621626
622627
-- Clean up any existing keys
623628
red_c:del("limit_req:{test_key}:state")

0 commit comments

Comments
 (0)