Added syncjob

This commit is contained in:
Sharpz7 2023-08-22 16:48:39 +00:00
parent f87cc43cdb
commit ff1659cb79

View File

@ -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{})