Skip to content

Commit 56393c4

Browse files
committed
change test to reflect timer nature of the disconnect
1 parent 05ca083 commit 56393c4

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

test/realtime/tenants/connect_test.exs

+7-2
Original file line numberDiff line numberDiff line change
@@ -56,10 +56,15 @@ defmodule Realtime.Tenants.ConnectTest do
5656
test "if no users are connected to a tenant channel, stop the connection", %{
5757
tenant: %{external_id: tenant_id}
5858
} do
59-
Connect.lookup_or_start_connection(tenant_id, check_connected_user_interval: 100)
59+
Connect.lookup_or_start_connection(tenant_id, check_connected_user_interval: 600)
60+
assert {_, %{conn: _}} = :syn.lookup(Connect, tenant_id)
6061

62+
# Not enough time has passed, connection still alive
63+
:timer.sleep(100)
6164
assert {_, %{conn: _}} = :syn.lookup(Connect, tenant_id)
62-
:timer.sleep(300)
65+
66+
# Enough time has passed, connection stopped
67+
:timer.sleep(1000)
6368
assert :undefined = :syn.lookup(Connect, tenant_id)
6469
end
6570

0 commit comments

Comments
 (0)