pass context to gomega

Change-Id: Ibef02a52d8922984a09efa48361b9876fc91287c
This commit is contained in:
Antonio Ojea 2022-12-19 12:54:01 +00:00
parent a864583905
commit e0a23577d2

View File

@ -109,9 +109,9 @@ var _ = SIGDescribe("CPU Manager Metrics [Serial][Feature:CPUManager]", func() {
}) })
ginkgo.By("Giving the Kubelet time to start up and produce metrics") ginkgo.By("Giving the Kubelet time to start up and produce metrics")
gomega.Eventually(getCPUManagerMetrics, 1*time.Minute, 15*time.Second).Should(matchResourceMetrics) gomega.Eventually(ctx, getCPUManagerMetrics, 1*time.Minute, 15*time.Second).Should(matchResourceMetrics)
ginkgo.By("Ensuring the metrics match the expectations a few more times") ginkgo.By("Ensuring the metrics match the expectations a few more times")
gomega.Consistently(getCPUManagerMetrics, 1*time.Minute, 15*time.Second).Should(matchResourceMetrics) gomega.Consistently(ctx, getCPUManagerMetrics, 1*time.Minute, 15*time.Second).Should(matchResourceMetrics)
}) })
ginkgo.It("should report pinning failures when the cpumanager allocation is known to fail", func(ctx context.Context) { ginkgo.It("should report pinning failures when the cpumanager allocation is known to fail", func(ctx context.Context) {
@ -132,9 +132,9 @@ var _ = SIGDescribe("CPU Manager Metrics [Serial][Feature:CPUManager]", func() {
}) })
ginkgo.By("Giving the Kubelet time to start up and produce metrics") ginkgo.By("Giving the Kubelet time to start up and produce metrics")
gomega.Eventually(getCPUManagerMetrics, 1*time.Minute, 15*time.Second).Should(matchResourceMetrics) gomega.Eventually(ctx, getCPUManagerMetrics, 1*time.Minute, 15*time.Second).Should(matchResourceMetrics)
ginkgo.By("Ensuring the metrics match the expectations a few more times") ginkgo.By("Ensuring the metrics match the expectations a few more times")
gomega.Consistently(getCPUManagerMetrics, 1*time.Minute, 15*time.Second).Should(matchResourceMetrics) gomega.Consistently(ctx, getCPUManagerMetrics, 1*time.Minute, 15*time.Second).Should(matchResourceMetrics)
}) })
ginkgo.It("should not report any pinning failures when the cpumanager allocation is expected to succeed", func(ctx context.Context) { ginkgo.It("should not report any pinning failures when the cpumanager allocation is expected to succeed", func(ctx context.Context) {
@ -155,9 +155,9 @@ var _ = SIGDescribe("CPU Manager Metrics [Serial][Feature:CPUManager]", func() {
}) })
ginkgo.By("Giving the Kubelet time to start up and produce metrics") ginkgo.By("Giving the Kubelet time to start up and produce metrics")
gomega.Eventually(getCPUManagerMetrics, 1*time.Minute, 15*time.Second).Should(matchResourceMetrics) gomega.Eventually(ctx, getCPUManagerMetrics, 1*time.Minute, 15*time.Second).Should(matchResourceMetrics)
ginkgo.By("Ensuring the metrics match the expectations a few more times") ginkgo.By("Ensuring the metrics match the expectations a few more times")
gomega.Consistently(getCPUManagerMetrics, 1*time.Minute, 15*time.Second).Should(matchResourceMetrics) gomega.Consistently(ctx, getCPUManagerMetrics, 1*time.Minute, 15*time.Second).Should(matchResourceMetrics)
}) })
}) })
}) })