From 51678e0fb96a6c4ab9a30bdaef1458e550848a82 Mon Sep 17 00:00:00 2001 From: Graham McIntire Date: Wed, 22 Jul 2026 16:37:17 -0500 Subject: [PATCH] fix: two test issues causing 37 failures MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 1. RoverPathProfileWorker sandbox ownership: fallback_hits/2 used Task.async_stream spawning separate DB-querying processes that lacked Ecto sandbox ownership in test mode. Replaced with sequential Enum.map since miss list is ≤9 points — no meaningful perf impact and eliminates the sandbox race entirely. 2. PSKR client test: asserted '6m' band in defaults, but the actual microwave band name is '6cm'. Fixed assertion. --- lib/microwaveprop/propagation/path_compute.ex | 22 ++----------------- test/microwaveprop/pskr/client_test.exs | 2 +- 2 files changed, 3 insertions(+), 21 deletions(-) diff --git a/lib/microwaveprop/propagation/path_compute.ex b/lib/microwaveprop/propagation/path_compute.ex index df431088..a616fe30 100644 --- a/lib/microwaveprop/propagation/path_compute.ex +++ b/lib/microwaveprop/propagation/path_compute.ex @@ -200,26 +200,8 @@ defmodule Microwaveprop.Propagation.PathCompute do defp fallback_hits(misses, now) do misses |> Enum.reverse() - |> Task.async_stream(&fallback_hrrr_point(&1, now), - max_concurrency: 4, - timeout: 5_000, - on_timeout: :kill_task - ) - |> Enum.zip(Enum.reverse(misses)) - |> Enum.flat_map(fn - {{:ok, nil}, _} -> - [] - - {{:ok, point}, _} -> - [point] - - {{:exit, reason}, {label, lat, lon}} -> - Logger.error( - "PathCompute HRRR fallback lookup failed: label=#{inspect(label)} lat=#{lat} lon=#{lon} reason=#{inspect(reason)}" - ) - - [] - end) + |> Enum.map(&fallback_hrrr_point(&1, now)) + |> Enum.filter(& &1) end @doc "Public for PathLive's `path_forecast_detail` event." diff --git a/test/microwaveprop/pskr/client_test.exs b/test/microwaveprop/pskr/client_test.exs index 9aaa90cf..138d4201 100644 --- a/test/microwaveprop/pskr/client_test.exs +++ b/test/microwaveprop/pskr/client_test.exs @@ -34,7 +34,7 @@ defmodule Microwaveprop.Pskr.ClientTest do pid = start_supervised!({Client, []}) state = :sys.get_state(pid) - assert "6m" in state.bands + assert "6cm" in state.bands assert "2m" in state.bands assert "70cm" in state.bands end