From 4ba2200d781ad2598c79ec9d4efa81a2ac68a590 Mon Sep 17 00:00:00 2001 From: Max Date: Sun, 31 Aug 2025 19:02:31 +0800 Subject: [PATCH] Update test error handling to use t.Fatal for critical execution checks - Changed instances of t.Error to t.Fatal in job test files to ensure immediate test termination when no executions are found, improving test reliability and clarity. --- job/job_test.go | 2 +- job/progress_test.go | 3 +-- job/worker_test.go | 3 +-- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/job/job_test.go b/job/job_test.go index faccb22e..3e83016a 100644 --- a/job/job_test.go +++ b/job/job_test.go @@ -449,7 +449,7 @@ func TestWorkerManager(t *testing.T) { } if len(executions) == 0 { - t.Error("Expected at least one execution") + t.Fatal("Expected at least one execution") } // Check execution status diff --git a/job/progress_test.go b/job/progress_test.go index 223f19eb..ac0c1610 100644 --- a/job/progress_test.go +++ b/job/progress_test.go @@ -125,8 +125,7 @@ func TestProgressWithExecution(t *testing.T) { t.Fatalf("Failed to get executions: %v", err) } if len(executions) == 0 { - t.Error("Expected at least one execution") - return + t.Fatal("Expected at least one execution") } execution := executions[0] diff --git a/job/worker_test.go b/job/worker_test.go index 815879a5..4d008d36 100644 --- a/job/worker_test.go +++ b/job/worker_test.go @@ -240,8 +240,7 @@ func TestWorkerErrorHandling(t *testing.T) { t.Fatalf("Failed to get executions: %v", err) } if len(executions) == 0 { - t.Error("Expected at least one execution") - return + t.Fatal("Expected at least one execution") } execution := executions[0]