Skip to content

Commit 0d23dc6

Browse files
committed
update tests.
1 parent 6cea825 commit 0d23dc6

1 file changed

Lines changed: 10 additions & 1 deletion

File tree

apps/cascade/lib/cascade/runtime/state_manager.ex

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,16 @@ defmodule Cascade.Runtime.StateManager do
109109
@impl true
110110
def handle_call({:update_task_status, job_id, task_id, new_status, opts}, _from, state) do
111111
# Find the task execution in Postgres
112-
task_executions = Workflows.list_task_executions_for_job(job_id)
112+
# Wrap in try-rescue to handle job deleted during test cleanup
113+
task_executions =
114+
try do
115+
Workflows.list_task_executions_for_job(job_id)
116+
rescue
117+
Ecto.NoResultsError ->
118+
Logger.debug("Job not found (likely deleted): job_id=#{job_id}")
119+
[]
120+
end
121+
113122
task_execution = Enum.find(task_executions, fn te -> te.task_id == task_id end)
114123

115124
if task_execution do

0 commit comments

Comments
 (0)