diff --git a/pkg/controller/job/job_controller_test.go b/pkg/controller/job/job_controller_test.go index 89482f80d1c6..1c53086c9df4 100644 --- a/pkg/controller/job/job_controller_test.go +++ b/pkg/controller/job/job_controller_test.go @@ -2406,9 +2406,13 @@ func TestSyncJobWhenManagedByLabel(t *testing.T) { actual = job return job, nil } - sharedInformerFactory.Batch().V1().Jobs().Informer().GetIndexer().Add(job) + if err := sharedInformerFactory.Batch().V1().Jobs().Informer().GetIndexer().Add(job); err != nil { + t.Fatalf("error %w while adding the %v job to the index", err) + } - manager.syncJob(context.TODO(), testutil.GetKey(job, t)) + if err := manager.syncJob(context.TODO(), testutil.GetKey(job, t)); err != nil { + t.Fatalf("error %w while reconciling the job %v", err, testutil.GetKey(job, t)) + } if diff := cmp.Diff(tc.wantStatus, actual.Status); diff != "" { t.Errorf("Unexpected job status (-want,+got):\n%s", diff)