@@ -1540,12 +1540,19 @@ var _ = framework.SIGDescribe("node")(framework.WithLabel("DRA"), feature.Dynami
15401540b .create (ctx , pod , template )
15411541b .testPod (ctx , f , pod )
15421542ginkgo .DeferCleanup (func (ctx context.Context ) {
1543- // Unblock shutdown by removing the finalizer.
1544- pod , err := f .ClientSet .CoreV1 ().Pods (f .Namespace .Name ).Get (ctx , pod .Name , metav1.GetOptions {})
1545- framework .ExpectNoError (err , "get pod" )
1546- pod .Finalizers = nil
1547- _ , err = f .ClientSet .CoreV1 ().Pods (f .Namespace .Name ).Update (ctx , pod , metav1.UpdateOptions {})
1548- framework .ExpectNoError (err , "remove finalizers from pod" )
1543+ gomega .Eventually (ctx , func (ctx context.Context ) error {
1544+ // Unblock shutdown by removing the finalizer.
1545+ pod , err := f .ClientSet .CoreV1 ().Pods (f .Namespace .Name ).Get (ctx , pod .Name , metav1.GetOptions {})
1546+ if err != nil {
1547+ return fmt .Errorf ("get pod: %w" , err )
1548+ }
1549+ pod .Finalizers = nil
1550+ _ , err = f .ClientSet .CoreV1 ().Pods (f .Namespace .Name ).Update (ctx , pod , metav1.UpdateOptions {})
1551+ if err != nil {
1552+ return fmt .Errorf ("remove finalizers from pod: %w" , err )
1553+ }
1554+ return nil
1555+ }).WithTimeout (30 * time .Second ).WithPolling (1 * time .Second ).Should (gomega .Succeed (), "Failed to remove finalizers" )
15491556})
15501557
15511558// Now evict it.
0 commit comments