Skip to content

Commit

Permalink
fix broken tests
Browse files Browse the repository at this point in the history
Signed-off-by: spacewander <[email protected]>
  • Loading branch information
spacewander committed Jan 30, 2023
1 parent 0575742 commit d057ef5
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
2 changes: 1 addition & 1 deletion t/plugin/grpc-transcode-reload-bugfix.t
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
9 changes: 9 additions & 0 deletions t/plugin/request-id-reload-bugfix.t
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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:
Expand Down

0 comments on commit d057ef5

Please sign in to comment.