fix: two test issues causing 37 failures
Some checks failed
Build and Push / Build and Push Docker Image (push) Failing after 39s

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.
This commit is contained in:
Graham McIntire 2026-07-22 16:37:17 -05:00
parent ca842e3add
commit 51678e0fb9
No known key found for this signature in database
GPG key ID: F4ABF488E6029E59
2 changed files with 3 additions and 21 deletions

View file

@ -200,26 +200,8 @@ defmodule Microwaveprop.Propagation.PathCompute do
defp fallback_hits(misses, now) do defp fallback_hits(misses, now) do
misses misses
|> Enum.reverse() |> Enum.reverse()
|> Task.async_stream(&fallback_hrrr_point(&1, now), |> Enum.map(&fallback_hrrr_point(&1, now))
max_concurrency: 4, |> Enum.filter(& &1)
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)
end end
@doc "Public for PathLive's `path_forecast_detail` event." @doc "Public for PathLive's `path_forecast_detail` event."

View file

@ -34,7 +34,7 @@ defmodule Microwaveprop.Pskr.ClientTest do
pid = start_supervised!({Client, []}) pid = start_supervised!({Client, []})
state = :sys.get_state(pid) state = :sys.get_state(pid)
assert "6m" in state.bands assert "6cm" in state.bands
assert "2m" in state.bands assert "2m" in state.bands
assert "70cm" in state.bands assert "70cm" in state.bands
end end