Skip to content

Commit

Permalink
Propagate gomega.Gomega on multikueue tests. (kubernetes-sigs#3309)
Browse files Browse the repository at this point in the history
  • Loading branch information
mbobrovskyi authored and PBundyra committed Nov 5, 2024
1 parent 801ac92 commit 02e31d9
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions test/e2e/multikueue/e2e_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -515,8 +515,8 @@ var _ = ginkgo.Describe("MultiKueue", func() {

podList := &corev1.PodList{}
podListOptions := client.InNamespace("kueue-system")
gomega.Eventually(func(g gomega.Gomega) error {
return k8sWorker1Client.List(ctx, podList, podListOptions)
gomega.Eventually(func(g gomega.Gomega) {
g.Expect(k8sWorker1Client.List(ctx, podList, podListOptions)).Should(gomega.Succeed())
}, util.LongTimeout, util.Interval).ShouldNot(gomega.Succeed())
})

Expand All @@ -538,19 +538,19 @@ var _ = ginkgo.Describe("MultiKueue", func() {
cmd := exec.Command("docker", "network", "connect", "kind", worker1Container)
output, err := cmd.CombinedOutput()
gomega.Expect(err).NotTo(gomega.HaveOccurred(), "%s: %s", err, output)
gomega.Eventually(func() error {
return util.DeleteObject(ctx, k8sWorker1Client, worker1Cq2)
}, util.LongTimeout, util.Interval).ShouldNot(gomega.HaveOccurred())
gomega.Eventually(func(g gomega.Gomega) {
g.Expect(util.DeleteObject(ctx, k8sWorker1Client, worker1Cq2)).Should(gomega.Succeed())
}, util.LongTimeout, util.Interval).Should(gomega.Succeed())

// After reconnecting the container to the network, when we try to get pods,
// we get it with the previous values (as before disconnect). Therefore, it
// takes some time for the cluster to restore them, and we got actually values.
// To be sure that the leader of kueue-control-manager successfully recovered
// we can check it by removing already created Cluster Queue.
var cq kueue.ClusterQueue
gomega.Eventually(func() error {
return k8sWorker1Client.Get(ctx, client.ObjectKeyFromObject(worker1Cq2), &cq)
}, util.LongTimeout, util.Interval).Should(utiltesting.BeNotFoundError())
gomega.Eventually(func(g gomega.Gomega) {
g.Expect(k8sWorker1Client.Get(ctx, client.ObjectKeyFromObject(worker1Cq2), &cq)).Should(utiltesting.BeNotFoundError())
}, util.LongTimeout, util.Interval).Should(gomega.Succeed())
})

ginkgo.By("Waiting for the cluster do become active", func() {
Expand Down

0 comments on commit 02e31d9

Please sign in to comment.