From ee16f81ed95702a40ffeda6be7b237c496e4cc44 Mon Sep 17 00:00:00 2001 From: Graham McIntire Date: Tue, 29 Jul 2025 12:44:12 -0500 Subject: [PATCH] Update Wallaby to 0.30.10 and suppress expected test error - Update Wallaby from 0.30.0 to 0.30.10 to fix struct update deprecation warnings - Suppress expected error output in BroadcastTaskSupervisor test using capture_log - Keeps test output clean while still verifying error handling behavior --- mix.exs | 2 +- test/aprsme/broadcast_task_supervisor_test.exs | 18 +++++++++++------- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/mix.exs b/mix.exs index 540f6f0..aecb914 100644 --- a/mix.exs +++ b/mix.exs @@ -108,7 +108,7 @@ defmodule Aprsme.MixProject do {:cachex, "~> 4.1"}, {:gettext_pseudolocalize, "~> 0.1"}, {:sentry, "~> 11.0"}, - {:wallaby, "~> 0.30.0", only: :test} + {:wallaby, "~> 0.30.10", only: :test} # Gleam dependencies ] end diff --git a/test/aprsme/broadcast_task_supervisor_test.exs b/test/aprsme/broadcast_task_supervisor_test.exs index f9ee326..10e73ab 100644 --- a/test/aprsme/broadcast_task_supervisor_test.exs +++ b/test/aprsme/broadcast_task_supervisor_test.exs @@ -1,5 +1,6 @@ defmodule Aprsme.BroadcastTaskSupervisorTest do use ExUnit.Case, async: true + import ExUnit.CaptureLog alias Aprsme.BroadcastTaskSupervisor @@ -89,14 +90,17 @@ defmodule Aprsme.BroadcastTaskSupervisorTest do end test "handles errors in async functions gracefully" do - # This should not crash the supervisor - {:ok, _pid} = - BroadcastTaskSupervisor.async_execute(fn -> - raise "Test error" - end) + # Capture logs to suppress the expected error output + capture_log(fn -> + # This should not crash the supervisor + {:ok, _pid} = + BroadcastTaskSupervisor.async_execute(fn -> + raise "Test error" + end) - # Give it time to fail - reduced from 50ms to 10ms - Process.sleep(10) + # Give it time to fail - reduced from 50ms to 10ms + Process.sleep(10) + end) # Supervisor should still be running stats = BroadcastTaskSupervisor.get_stats()