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

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

commit d057ef55d08ec3266802fef4a5420885c9720912
Author: spacewander <[email protected]>
AuthorDate: Sun Jan 29 11:07:57 2023 +0800

    fix broken tests
    
    Signed-off-by: spacewander <[email protected]>
---
 t/plugin/grpc-transcode-reload-bugfix.t | 2 +-
 t/plugin/request-id-reload-bugfix.t     | 9 +++++++++
 2 files changed, 10 insertions(+), 1 deletion(-)

diff --git a/t/plugin/grpc-transcode-reload-bugfix.t 
b/t/plugin/grpc-transcode-reload-bugfix.t
index 7eee56f16..556b2cad2 100644
--- a/t/plugin/grpc-transcode-reload-bugfix.t
+++ b/t/plugin/grpc-transcode-reload-bugfix.t
@@ -34,7 +34,7 @@ add_block_preprocessor(sub {
     close_cnt = 0
     core.config.new = function(key, opts)
         local obj, err = orig_new(key, opts)
-        if key == "/protos" then
+        if key == "/proto" then
             local orig_close = obj.close
             obj.close = function(...)
                 core.log.warn("call config close")
diff --git a/t/plugin/request-id-reload-bugfix.t 
b/t/plugin/request-id-reload-bugfix.t
index 71775e7d9..1b4bb5fe1 100644
--- a/t/plugin/request-id-reload-bugfix.t
+++ b/t/plugin/request-id-reload-bugfix.t
@@ -33,6 +33,12 @@ add_block_preprocessor(sub {
     local orig_new = core.etcd.new
     core.etcd.new = function(...)
         local cli, prefix = orig_new(...)
+        -- in 2.15.x, there is an extra call in init_worker phase
+        -- so when backporting this fix, we need to filter out the
+        -- extra call in the test
+        if ngx.get_phase() ~= "timer" then
+            return cli, prefix
+        end
         cli.keepalive = function(...)
             return false, "test error"
         end
@@ -61,6 +67,9 @@ __DATA__
 
 === TEST 1: unregister timer when etcd keepalive failed
 --- yaml_config
+apisix:
+  node_listen: 1984
+  admin_key: null
 plugins:
     - request-id
 plugin_attr:

Reply via email to