Fix flaky deferred_discovery timeout test — use receive instead of Process.sleep for deterministic blocking
This commit is contained in:
parent
a4e08b2aca
commit
bdf22cd411
1 changed files with 6 additions and 4 deletions
|
|
@ -67,8 +67,9 @@ defmodule Towerops.Snmp.DeferredDiscoveryTest do
|
|||
DeferredDiscovery.slow_check(
|
||||
client_opts,
|
||||
fn ->
|
||||
Process.sleep(30)
|
||||
{:ok, "too slow"}
|
||||
receive do
|
||||
:never -> {:ok, "too slow"}
|
||||
end
|
||||
end,
|
||||
timeout: 25,
|
||||
default: []
|
||||
|
|
@ -84,8 +85,9 @@ defmodule Towerops.Snmp.DeferredDiscoveryTest do
|
|||
DeferredDiscovery.slow_check(
|
||||
client_opts,
|
||||
fn ->
|
||||
Process.sleep(30)
|
||||
{:ok, "too slow"}
|
||||
receive do
|
||||
:never -> {:ok, "too slow"}
|
||||
end
|
||||
end,
|
||||
timeout: 25,
|
||||
default: %{status: :timeout}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue