Skip to content

Commit

Permalink
test: avoid unstable case caused by delete upstream 1 (apache#3385)
Browse files Browse the repository at this point in the history
Test cases from other files may still refer upstream 1.
  • Loading branch information
spacewander authored Jan 21, 2021
1 parent c030783 commit bf16615
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions t/node/healthcheck-stop-checker.t
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ create new checker: table: 0x
content_by_lua_block {
local t = require("lib.test_admin").test

local code, _, body = t('/apisix/admin/upstreams/1',
local code, _, body = t('/apisix/admin/upstreams/stopchecker',
"PUT",
[[{"type":"roundrobin","nodes":{"127.0.0.1:1980":1,"127.0.0.1:1981":1},"checks":{"active":{"http_path":"/status","healthy":{"interval":1,"successes":1},"unhealthy":{"interval":1,"http_failures":2}}}}]]
)
Expand All @@ -160,7 +160,7 @@ create new checker: table: 0x
-- release the clean handler of previous test
local code, _, body = t('/apisix/admin/routes/1',
"PUT",
[[{"uri":"/server_port","upstream_id":1}]]
[[{"uri":"/server_port","upstream_id":"stopchecker"}]]
)

if code > 300 then
Expand All @@ -181,7 +181,7 @@ create new checker: table: 0x
ngx.sleep(0.5)

-- update
code, _, body = t('/apisix/admin/upstreams/1',
code, _, body = t('/apisix/admin/upstreams/stopchecker',
"PUT",
[[{"type":"roundrobin","nodes":{"127.0.0.1:1980":1,"127.0.0.1:1981":1},"checks":{"active":{"http_path":"/void","healthy":{"interval":1,"successes":1},"unhealthy":{"interval":1,"http_failures":1}}}}]]
)
Expand Down Expand Up @@ -210,7 +210,7 @@ create new checker: table: 0x
return
end

code, _, body = t('/apisix/admin/upstreams/1', "DELETE")
code, _, body = t('/apisix/admin/upstreams/stopchecker', "DELETE")

if code > 300 then
ngx.status = code
Expand Down

0 comments on commit bf16615

Please sign in to comment.