Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(tests): fix flaky due to too close time for a timer #12696

Merged
merged 1 commit into from
Mar 13, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -348,10 +348,12 @@ for _, strategy in helpers.each_strategy() do
assert(cluster_events_1:poll())
assert.spy(spy_func).was_not_called() -- still not called

ngx.sleep(delay + 0.1) -- go past our desired `nbf` delay
ngx.sleep(delay) -- go past our desired `nbf` delay

assert(cluster_events_1:poll())
assert.spy(spy_func).was_called(1) -- called
helpers.wait_until(function()
assert(cluster_events_1:poll())
return pcall(assert.spy(spy_func).was_called, 1) -- called
end, 1) -- note that we have already waited for `delay` seconds
end)
end)
end)
Expand Down
Loading