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.
This commit is contained in:
Max 2025-08-31 19:02:31 +08:00
parent 5612fb58e2
commit 4ba2200d78
3 changed files with 3 additions and 5 deletions

View file

@ -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

View file

@ -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]

View file

@ -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]