mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-21 10:51:29 +00:00
Fix flaky test
This commit is contained in:
parent
5699e6d3ea
commit
102a669ca1
@ -28,6 +28,7 @@ import (
|
||||
"strconv"
|
||||
"time"
|
||||
|
||||
apierrors "k8s.io/apimachinery/pkg/api/errors"
|
||||
"k8s.io/apimachinery/pkg/fields"
|
||||
|
||||
"github.com/onsi/ginkgo"
|
||||
@ -223,8 +224,9 @@ var _ = SIGDescribe("GracefulNodeShutdown [Serial] [NodeFeature:GracefulNodeShut
|
||||
ginkgo.Context("when gracefully shutting down with Pod priority", func() {
|
||||
|
||||
const (
|
||||
pollInterval = 1 * time.Second
|
||||
podStatusUpdateTimeout = 10 * time.Second
|
||||
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{})
|
||||
framework.ExpectNoError(err)
|
||||
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() {
|
||||
|
Loading…
Reference in New Issue
Block a user