Skip to content

Commit

Permalink
[util/e2e] Rework KueueReadyForTesting.
Browse files Browse the repository at this point in the history
  • Loading branch information
trasc committed Jan 30, 2024
1 parent 25dd4bf commit 1031a49
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 6 deletions.
4 changes: 2 additions & 2 deletions test/util/constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ const (
// such as running pods to completion.
LongTimeout = 45 * time.Second
// StartupTimeout is meant to be used for waiting for Kueue to startup, given
// that cert updates can take up to 2 minutes to propagate to the filesystem.
StartUpTimeout = 3 * time.Minute
// that cert updates can take up to 3 minutes to propagate to the filesystem.
StartUpTimeout = 4 * time.Minute
ConsistentDuration = time.Second * 3
Interval = time.Millisecond * 250
)
16 changes: 12 additions & 4 deletions test/util/e2e.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,11 +65,19 @@ func CreateVisibilityClient(user string) visibilityv1alpha1.VisibilityV1alpha1In
return visibilityClient
}

func KueueReadyForTesting(ctx context.Context, client client.Client) {
func KueueReadyForTesting(ctx context.Context, c client.Client) {
// To verify that webhooks are ready, let's create a simple resourceflavor
resourceKueue := utiltesting.MakeResourceFlavor("default").Obj()
gomega.Eventually(func() error {
return client.Create(context.Background(), resourceKueue)
gomega.EventuallyWithOffset(1, func() error {
return c.Create(ctx, resourceKueue)
}, StartUpTimeout, Interval).Should(gomega.Succeed())
ExpectResourceFlavorToBeDeleted(ctx, client, resourceKueue, true)

gomega.EventuallyWithOffset(1, func() error {
return c.Delete(ctx, resourceKueue)
}, LongTimeout, Interval).Should(gomega.Succeed())

gomega.EventuallyWithOffset(1, func() error {
oldRf := &kueue.ResourceFlavor{}
return c.Get(ctx, client.ObjectKeyFromObject(resourceKueue), oldRf)
}, LongTimeout, Interval).Should(utiltesting.BeNotFoundError())
}

0 comments on commit 1031a49

Please sign in to comment.