Increase flaky test timeout (#2330)

This commit is contained in:
Vinicius Brasil 2022-10-13 09:56:25 -03:00 committed by GitHub
parent 28cec9d939
commit c26e029d22
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -145,13 +145,13 @@ defmodule Plausible.TestUtils do
end end
def eventually(expectation, wait_time_ms \\ 50, retries \\ 10) do def eventually(expectation, wait_time_ms \\ 50, retries \\ 10) do
Enum.reduce_while(1..retries, nil, fn _i, _acc -> Enum.reduce_while(1..retries, nil, fn attempt, _acc ->
case expectation.() do case expectation.() do
{true, result} -> {true, result} ->
{:halt, result} {:halt, result}
{false, _} -> {false, _} ->
Process.sleep(wait_time_ms) Process.sleep(wait_time_ms * attempt)
{:cont, nil} {:cont, nil}
end end
end) end)