Skip to content

Commit

Permalink
fix(ci): stability of consul test cases (apache#10857)
Browse files Browse the repository at this point in the history
  • Loading branch information
AlinsRan authored Jan 23, 2024
1 parent f91861f commit 3a48d17
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions t/discovery/consul_dump.t
Original file line number Diff line number Diff line change
Expand Up @@ -492,14 +492,19 @@ discovery:
content_by_lua_block {
local json = require("toolkit.json")
local t = require("lib.test_admin")
ngx.sleep(2)
local code, body, res = t.test('/v1/discovery/consul/show_dump_file',
ngx.HTTP_GET)
local entity = json.decode(res)
ngx.say(json.encode(entity.services))
for i = 1, 3 do
ngx.sleep(2)
local code, body, res = t.test('/v1/discovery/consul/show_dump_file',
ngx.HTTP_GET)
local entity = json.decode(res)
if entity.services and entity.services.service_a then
ngx.say(json.encode(entity.services))
return
end
end
}
}
--- timeout: 3
--- timeout: 8
--- request
GET /t
--- response_body
Expand Down

0 comments on commit 3a48d17

Please sign in to comment.