diff --git a/internal/jobs/worker_test.go b/internal/jobs/worker_test.go index 05d398e..40323a9 100644 --- a/internal/jobs/worker_test.go +++ b/internal/jobs/worker_test.go @@ -58,10 +58,14 @@ func TestParallelModuleRefresh_CoalescesDeployApply(t *testing.T) { var deferred, withDeployID int refreshJobs, _, _ := reg.List(tenant, "", KindModuleRefresh, "", 100) for _, j := range refreshJobs { - if j.Status != StatusSucceeded { + if j == nil { continue } - meta := j.Snapshot()["meta"].(map[string]any) + snap := j.Snapshot() + if st, _ := snap["status"].(string); st != StatusSucceeded { + continue + } + meta, _ := snap["meta"].(map[string]any) if v, ok := meta["deploy_apply_deferred"].(bool); ok && v { deferred++ } @@ -89,10 +93,13 @@ func waitSucceededJobsByKindCount(t *testing.T, reg *Registry, tenant, kind stri } all, _, _ := reg.List(tenant, "", kind, "", 100) for _, j := range all { - if j == nil || j.Status != StatusFailed { + if j == nil { continue } snap := j.Snapshot() + if st, _ := snap["status"].(string); st != StatusFailed { + continue + } t.Fatalf("%s job failed: %#v", kind, snap["error"]) } time.Sleep(5 * time.Millisecond)