Skip to content

Commit

Permalink
fix flakiness from other prs
Browse files Browse the repository at this point in the history
  • Loading branch information
chobits committed Dec 2, 2024
1 parent 9df2334 commit 8c8da0e
Showing 1 changed file with 13 additions and 11 deletions.
24 changes: 13 additions & 11 deletions spec/02-integration/09-hybrid_mode/01-sync_spec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -260,20 +260,22 @@ describe("CP/DP communication #" .. strategy .. " inc_sync=" .. inc_sync, functi
headers = {["Content-Type"] = "application/json"}
}))
assert.res_status(200, res)
-- as this is testing a negative behavior, there is no sure way to wait
-- this can probably be optimizted
ngx.sleep(2)

local proxy_client = helpers.http_client("127.0.0.1", 9002)
helpers.wait_until(function()
local proxy_client = helpers.http_client("127.0.0.1", 9002)

-- test route again
res = assert(proxy_client:send({
method = "GET",
path = "/soon-to-be-disabled",
}))
assert.res_status(404, res)
-- test route again
res = assert(proxy_client:send({
method = "GET",
path = "/soon-to-be-disabled",
}))

proxy_client:close()
local status = res and res.status
proxy_client:close()
if status == 404 then
return true
end
end)
end)

it('does not sync plugins on a route attached to a disabled service', function()
Expand Down

0 comments on commit 8c8da0e

Please sign in to comment.