You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by sp...@apache.org on 2022/04/14 02:38:13 UTC

[apisix] branch master updated: ci: upgrade ancient redis image (#6838)

This is an automated email from the ASF dual-hosted git repository.

spacewander pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/apisix.git


The following commit(s) were added to refs/heads/master by this push:
     new d7310e939 ci: upgrade ancient redis image (#6838)
d7310e939 is described below

commit d7310e939343b8a9d4b463a2e5a6fd3c408b0b7e
Author: 罗泽轩 <sp...@gmail.com>
AuthorDate: Thu Apr 14 10:38:05 2022 +0800

    ci: upgrade ancient redis image (#6838)
---
 ci/pod/docker-compose.yml     |  3 ++-
 t/plugin/limit-count-redis.t  | 20 +++-----------------
 t/plugin/limit-count-redis2.t |  2 +-
 3 files changed, 6 insertions(+), 19 deletions(-)

diff --git a/ci/pod/docker-compose.yml b/ci/pod/docker-compose.yml
index 62d4dcb93..1804fbf2e 100644
--- a/ci/pod/docker-compose.yml
+++ b/ci/pod/docker-compose.yml
@@ -20,7 +20,8 @@ version: "3.8"
 services:
   ## Redis
   apisix_redis:
-    image: redis:3.0-alpine
+    # The latest image is the latest stable version
+    image: redis:latest
     restart: unless-stopped
     ports:
       - "6379:6379"
diff --git a/t/plugin/limit-count-redis.t b/t/plugin/limit-count-redis.t
index 718603139..a777a3871 100644
--- a/t/plugin/limit-count-redis.t
+++ b/t/plugin/limit-count-redis.t
@@ -219,14 +219,7 @@ unlock with key route#1#redis
             local count
             count, err = red:get_reused_times()
             if 0 == count then
-                local res, err = red:eval([[
-                    local key = 'requirepass'
-                    local value = "foobared"
-                    -- redis.replicate_commands()
-                    local val = redis.pcall('CONFIG', 'SET', key, value)
-                    return val
-                    ]], 0)
-                --
+                local res, err = red:config('set', 'requirepass', 'foobared')
                 if not res then
                     ngx.say("failed to set: ", err)
                     return
@@ -337,7 +330,7 @@ GET /hello_new
 --- error_code eval
 500
 --- error_log
-failed to limit count: ERR invalid password
+failed to limit count: WRONGPASS invalid username-password pair or user is disabled
 
 
 
@@ -386,14 +379,7 @@ failed to limit count: ERR invalid password
                         return nil, err
                     end
                 end
-                local res, err = red:eval([[
-                    local key = 'requirepass'
-                    local value = ''
-                    -- redis.replicate_commands()
-                    local val = redis.pcall('CONFIG', 'SET', key, value)
-                    return val
-                    ]], 0)
-                --
+                local res, err = red:config('set', 'requirepass', '')
                 if not res then
                     ngx.say("failed to set: ", err)
                     return
diff --git a/t/plugin/limit-count-redis2.t b/t/plugin/limit-count-redis2.t
index a9f23e858..f4f4ea131 100644
--- a/t/plugin/limit-count-redis2.t
+++ b/t/plugin/limit-count-redis2.t
@@ -136,7 +136,7 @@ GET /hello
 --- error_code eval
 500
 --- error_log
-failed to limit count: failed to change redis db, err: ERR invalid DB index
+failed to limit count: failed to change redis db, err: ERR DB index is out of range