chore(portal): add assert_receive to wait until pid is started (#3973)

Should fix
https://github.com/firezone/firezone/actions/runs/8159796064/job/22304910482#step:12:20
This commit is contained in:
Jamil
2024-03-05 09:39:31 -08:00
committed by GitHub
parent e49cb8991c
commit 6b04fdf045

View File

@@ -30,6 +30,7 @@ defmodule Domain.Jobs.Executors.GlobalTest do
test "registers itself as a leader if there is no global name registered" do
assert {:ok, pid} = start_link({{__MODULE__, :send_test_message}, 25, test_pid: self()})
assert_receive {:executed, ^pid, _time}, 500
name = {Domain.Jobs.Executors.Global, __MODULE__, :send_test_message}
assert :global.whereis_name(name) == pid
@@ -54,6 +55,8 @@ defmodule Domain.Jobs.Executors.GlobalTest do
assert {:ok, fallback2_pid} =
start_link({{__MODULE__, :send_test_message}, 25, test_pid: self()})
assert_receive {:executed, ^leader_pid, _time}, 500
name = {Domain.Jobs.Executors.Global, __MODULE__, :send_test_message}
assert :global.whereis_name(name) == leader_pid