Skip to content

Commit

Permalink
remove sleep from test file
Browse files Browse the repository at this point in the history
  • Loading branch information
AntoineJac authored Apr 26, 2024
1 parent b7e772c commit 4983045
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions spec/02-integration/22-ai_plugins/01-reports_spec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,13 @@ for _, strategy in helpers.each_strategy() do

describe("anonymous reports for ai plugins #" .. strategy, function()
local reports_send_ping = function(port)
ngx.sleep(0.2) -- hand over the CPU so other threads can do work (processing the sent data)
admin_client = helpers.admin_client()
local res = admin_client:post("/reports/send-ping" .. (port and "?port=" .. port or ""))
assert.response(res).has_status(200)
admin_client:close()
assert.eventually(function()
admin_client = helpers.admin_client()
local res = admin_client:post("/reports/send-ping" .. (port and "?port=" .. port or ""))
assert.response(res).has_status(200)
admin_client:close()
end)
.has_no_error("ping request was sent successfully")
end

lazy_setup(function()
Expand Down

0 comments on commit 4983045

Please sign in to comment.