Skip to content

Commit

Permalink
fix test cases
Browse files Browse the repository at this point in the history
  • Loading branch information
chobits committed May 31, 2024
1 parent 7ea92b5 commit 8e7a60c
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
2 changes: 1 addition & 1 deletion spec/01-unit/14-dns_spec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ describe("DNS", function()
resolver.new = old_new
end)

it("returns an error and 503 on a Name Error (3)", function()
it("returns an error and 503 on a Name Error (3) #ttt", function()
setup_it_block()
mock_records = {
["konghq.com:" .. resolver.TYPE_A] = { errcode = 3, errstr = "name error" },
Expand Down
8 changes: 5 additions & 3 deletions spec/02-integration/05-proxy/05-dns_spec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ for _, strategy in helpers.each_strategy() do

local service = bp.services:insert {
name = "tests-retries",
host = "nowthisdoesnotexistatall.com",
host = "nowthisdoesnotexistatall",
path = "/exist",
port = 80,
protocol = "http"
Expand All @@ -134,15 +134,17 @@ for _, strategy in helpers.each_strategy() do
helpers.stop_kong()
end)

it("fails with 503", function()
it("fails with 500", function()
local r = proxy_client:send {
method = "GET",
path = "/",
headers = {
host = "retries.test"
}
}
assert.response(r).has.status(503)
-- The DNS server will reply "(2) server failure" for the domain in A
-- type without dot, like "nowthisdoesnotexistatall"
assert.response(r).has.status(500)
end)
end)

Expand Down
4 changes: 3 additions & 1 deletion spec/02-integration/14-tracing/01-instrumentations_spec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -546,7 +546,9 @@ for _, strategy in helpers.each_strategy() do
method = "GET",
path = "/test",
})
assert.res_status(503, r)
-- The DNS server will reply "(2) server failure" for the domain in A
-- type without dot, like "really-inexist-host"
assert.res_status(500, r)

-- Getting back the TCP server input
local ok, res = thread:join()
Expand Down

0 comments on commit 8e7a60c

Please sign in to comment.