mirror of
https://github.com/plausible/analytics.git
synced 2024-12-24 18:12:44 +03:00
Increase flaky test timeout (#2330)
This commit is contained in:
parent
28cec9d939
commit
c26e029d22
@ -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)
|
||||||
|
Loading…
Reference in New Issue
Block a user