From ff1659cb79823d58e0bb1cb78bc37d1d67ab1236 Mon Sep 17 00:00:00 2001 From: Sharpz7 Date: Tue, 22 Aug 2023 16:48:39 +0000 Subject: [PATCH] Added syncjob --- pkg/controller/job/job_controller_test.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/pkg/controller/job/job_controller_test.go b/pkg/controller/job/job_controller_test.go index 3dd201737f8..b6a98e8e46e 100644 --- a/pkg/controller/job/job_controller_test.go +++ b/pkg/controller/job/job_controller_test.go @@ -5190,7 +5190,7 @@ func TestBackupFinalizerRemoval(t *testing.T) { // This is done above by initializing the manager and not calling manager.Run() yet. // 2. Create a job. - job := newJob(2, 2, 6, batch.NonIndexedCompletion) + job := newJob(1, 1, 1, batch.NonIndexedCompletion) // 3. Create the pods. podBuilder := buildPod().name("test_pod").deletionTimestamp().trackingFinalizer().job(job) @@ -5208,6 +5208,11 @@ func TestBackupFinalizerRemoval(t *testing.T) { // 5. Start the workers. go manager.Run(context.TODO(), 0) + err = manager.syncJob(context.TODO(), testutil.GetKey(job, t)) + if err != nil { + t.Errorf("Unexpected error when syncing jobs %v", err) + } + // Check if the finalizer has been removed from the pod. if err := wait.Poll(100*time.Millisecond, wait.ForeverTestTimeout, func() (bool, error) { p, err := clientset.CoreV1().Pods(pod.Namespace).Get(context.Background(), pod.Name, metav1.GetOptions{})