Skip to content

Commit 34b0e56

Browse files
committed
chore: update tests
1 parent 551e330 commit 34b0e56

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

test/integration/rt_channel_test.exs

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1770,6 +1770,18 @@ defmodule Realtime.Integration.RtChannelTest do
17701770
}
17711771
},
17721772
500
1773+
1774+
# Limit is updated now joining should succeed
1775+
Realtime.Tenants.Cache.update_cache(%{tenant | max_concurrent_users: 2})
1776+
1777+
WebsocketClient.join(socket2, topic3, %{config: config})
1778+
1779+
assert_receive %Message{
1780+
event: "phx_reply",
1781+
topic: ^topic3,
1782+
payload: %{"response" => %{"postgres_changes" => []}, "status" => "ok"}
1783+
},
1784+
500
17731785
end
17741786

17751787
test "max_events_per_second limit respected", %{tenant: tenant, serializer: serializer} do
@@ -1836,6 +1848,18 @@ defmodule Realtime.Integration.RtChannelTest do
18361848

18371849
refute_receive %Message{event: "phx_reply", topic: ^realtime_topic_2}, 500
18381850
refute_receive %Message{event: "presence_state", topic: ^realtime_topic_2}, 500
1851+
1852+
# Limit is updated now joining should succeed
1853+
Realtime.Tenants.Cache.update_cache(%{tenant | max_channels_per_client: 2})
1854+
1855+
WebsocketClient.join(socket, realtime_topic_2, %{config: config})
1856+
1857+
assert_receive %Message{
1858+
event: "phx_reply",
1859+
payload: %{"response" => %{"postgres_changes" => []}, "status" => "ok"},
1860+
topic: ^realtime_topic_2
1861+
},
1862+
500
18391863
end
18401864

18411865
test "max_joins_per_second limit respected", %{tenant: tenant, serializer: serializer} do

0 commit comments

Comments
 (0)