Skip to content

Commit 85e8120

Browse files
authored
chore: misc fixes (#1597)
1 parent dec8f0c commit 85e8120

File tree

3 files changed

+10
-12
lines changed

3 files changed

+10
-12
lines changed

test/realtime/syn_handler_test.exs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,7 @@ defmodule Realtime.SynHandlerTest do
271271
end
272272
end
273273

274-
defp assert_process_down(pid, reason \\ nil, timeout \\ 100) do
274+
defp assert_process_down(pid, reason, timeout) do
275275
ref = Process.monitor(pid)
276276

277277
if reason do

test/realtime_web/channels/realtime_channel/broadcast_handler_test.exs

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ defmodule RealtimeWeb.RealtimeChannel.BroadcastHandlerTest do
115115
socket
116116
end
117117

118-
refute_received {:socket_push, :text, _}, 120
118+
refute_receive {:socket_push, :text, _}, 120
119119
end
120120

121121
@tag policies: [:read_matching_user_role, :write_matching_user_role], role: "anon"
@@ -154,7 +154,7 @@ defmodule RealtimeWeb.RealtimeChannel.BroadcastHandlerTest do
154154
socket
155155
end
156156

157-
refute_received {:socket_push, :text, _}, 120
157+
refute_receive {:socket_push, :text, _}, 120
158158
end
159159

160160
test "with nil policy and invalid user, won't send message", %{topic: topic, tenant: tenant, db_conn: db_conn} do
@@ -209,9 +209,7 @@ defmodule RealtimeWeb.RealtimeChannel.BroadcastHandlerTest do
209209
socket
210210
end
211211

212-
Process.sleep(100)
213-
214-
refute_received _
212+
refute_receive _, 100
215213
end
216214

217215
test "no ack still sends message", %{topic: topic, tenant: tenant, db_conn: db_conn} do
@@ -291,7 +289,7 @@ defmodule RealtimeWeb.RealtimeChannel.BroadcastHandlerTest do
291289
{:noreply, _socket} = BroadcastHandler.handle(%{}, db_conn, socket)
292290

293291
# Enough for the RateCounter to calculate the last bucket
294-
refute_received _, 1200
292+
refute_receive _, 1200
295293
end)
296294

297295
assert log =~ "RlsPolicyError"
@@ -314,7 +312,7 @@ defmodule RealtimeWeb.RealtimeChannel.BroadcastHandlerTest do
314312
socket
315313
)
316314

317-
refute_received {:socket_push, :text, _}, 120
315+
refute_receive {:socket_push, :text, _}, 120
318316
end
319317

320318
test "handle payload size excedding limits in public channels", %{topic: topic, tenant: tenant, db_conn: db_conn} do
@@ -327,7 +325,7 @@ defmodule RealtimeWeb.RealtimeChannel.BroadcastHandlerTest do
327325
socket
328326
)
329327

330-
refute_received {:socket_push, :text, _}, 120
328+
refute_receive {:socket_push, :text, _}, 120
331329
end
332330

333331
test "handle payload size excedding limits in private channel and if ack it will receive error", %{
@@ -348,7 +346,7 @@ defmodule RealtimeWeb.RealtimeChannel.BroadcastHandlerTest do
348346
socket
349347
)
350348

351-
refute_received {:socket_push, :text, _}, 120
349+
refute_receive {:socket_push, :text, _}, 120
352350
end
353351

354352
test "handle payload size excedding limits in public channels and if ack it will receive error", %{
@@ -365,7 +363,7 @@ defmodule RealtimeWeb.RealtimeChannel.BroadcastHandlerTest do
365363
socket
366364
)
367365

368-
refute_received {:socket_push, :text, _}, 120
366+
refute_receive {:socket_push, :text, _}, 120
369367
end
370368
end
371369

test/realtime_web/channels/realtime_channel_test.exs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,7 @@ defmodule RealtimeWeb.RealtimeChannelTest do
261261
{:ok, manager_pid, _conn} = Extensions.PostgresCdcRls.get_manager_conn(tenant.external_id)
262262
Extensions.PostgresCdcRls.update_meta(tenant.external_id, manager_pid, conn)
263263

264-
assert {:ok, reply, socket} = subscribe_and_join(socket, "realtime:test_fail", %{"config" => config})
264+
assert {:ok, _reply, socket} = subscribe_and_join(socket, "realtime:test_fail", %{"config" => config})
265265

266266
assert_push "system",
267267
%{message: message, status: "error", extension: "postgres_changes", channel: "test_fail"},

0 commit comments

Comments
 (0)