mirror of
				https://github.com/optim-enterprises-bv/kubernetes.git
				synced 2025-11-04 12:18:16 +00:00 
			
		
		
		
	Fix flaky test
This commit is contained in:
		@@ -28,6 +28,7 @@ import (
 | 
			
		||||
	"strconv"
 | 
			
		||||
	"time"
 | 
			
		||||
 | 
			
		||||
	apierrors "k8s.io/apimachinery/pkg/api/errors"
 | 
			
		||||
	"k8s.io/apimachinery/pkg/fields"
 | 
			
		||||
 | 
			
		||||
	"github.com/onsi/ginkgo"
 | 
			
		||||
@@ -225,6 +226,7 @@ var _ = SIGDescribe("GracefulNodeShutdown [Serial] [NodeFeature:GracefulNodeShut
 | 
			
		||||
		const (
 | 
			
		||||
			pollInterval                 = 1 * time.Second
 | 
			
		||||
			podStatusUpdateTimeout       = 10 * time.Second
 | 
			
		||||
			priorityClassesCreateTimeout = 10 * time.Second
 | 
			
		||||
		)
 | 
			
		||||
 | 
			
		||||
		var (
 | 
			
		||||
@@ -271,11 +273,22 @@ var _ = SIGDescribe("GracefulNodeShutdown [Serial] [NodeFeature:GracefulNodeShut
 | 
			
		||||
 | 
			
		||||
			ginkgo.By("Wait for the node to be ready")
 | 
			
		||||
			waitForNodeReady()
 | 
			
		||||
 | 
			
		||||
			for _, customClass := range []*schedulingv1.PriorityClass{customClassA, customClassB, customClassC} {
 | 
			
		||||
			customClasses := []*schedulingv1.PriorityClass{customClassA, customClassB, customClassC}
 | 
			
		||||
			for _, customClass := range customClasses {
 | 
			
		||||
				_, err := f.ClientSet.SchedulingV1().PriorityClasses().Create(context.Background(), customClass, metav1.CreateOptions{})
 | 
			
		||||
				if err != nil && !apierrors.IsAlreadyExists(err) {
 | 
			
		||||
					framework.ExpectNoError(err)
 | 
			
		||||
				}
 | 
			
		||||
			}
 | 
			
		||||
			gomega.Eventually(func() error {
 | 
			
		||||
				for _, customClass := range customClasses {
 | 
			
		||||
					_, err := f.ClientSet.SchedulingV1().PriorityClasses().Get(context.Background(), customClass.Name, metav1.GetOptions{})
 | 
			
		||||
					if err != nil {
 | 
			
		||||
						return err
 | 
			
		||||
					}
 | 
			
		||||
				}
 | 
			
		||||
				return nil
 | 
			
		||||
			}, priorityClassesCreateTimeout, pollInterval).Should(gomega.BeNil())
 | 
			
		||||
		})
 | 
			
		||||
 | 
			
		||||
		ginkgo.AfterEach(func() {
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user