From 51c6a1fbe789919c53372eb128151c8608b5a1a3 Mon Sep 17 00:00:00 2001 From: Swati Sehgal Date: Thu, 19 Jan 2023 14:18:05 +0000 Subject: [PATCH] node: e2e: cpumgr: Rename: s/getCPUManagerMetrics/getKubeletMetrics Since we need to gather kubelet metrics for CPU Manager and Topology Manager, renaming this function to a more generic name. Signed-off-by: Swati Sehgal --- test/e2e_node/cpu_manager_metrics_test.go | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/test/e2e_node/cpu_manager_metrics_test.go b/test/e2e_node/cpu_manager_metrics_test.go index ebf4986eb15..a477e1bf1bb 100644 --- a/test/e2e_node/cpu_manager_metrics_test.go +++ b/test/e2e_node/cpu_manager_metrics_test.go @@ -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") - gomega.Eventually(ctx, getCPUManagerMetrics, 1*time.Minute, 15*time.Second).Should(matchResourceMetrics) + gomega.Eventually(ctx, getKubeletMetrics, 1*time.Minute, 15*time.Second).Should(matchResourceMetrics) ginkgo.By("Ensuring the metrics match the expectations a few more times") - gomega.Consistently(ctx, getCPUManagerMetrics, 1*time.Minute, 15*time.Second).Should(matchResourceMetrics) + gomega.Consistently(ctx, getKubeletMetrics, 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) { @@ -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") - gomega.Eventually(ctx, getCPUManagerMetrics, 1*time.Minute, 15*time.Second).Should(matchResourceMetrics) + gomega.Eventually(ctx, getKubeletMetrics, 1*time.Minute, 15*time.Second).Should(matchResourceMetrics) ginkgo.By("Ensuring the metrics match the expectations a few more times") - gomega.Consistently(ctx, getCPUManagerMetrics, 1*time.Minute, 15*time.Second).Should(matchResourceMetrics) + gomega.Consistently(ctx, getKubeletMetrics, 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) { @@ -155,16 +155,15 @@ var _ = SIGDescribe("CPU Manager Metrics [Serial][Feature:CPUManager]", func() { }) ginkgo.By("Giving the Kubelet time to start up and produce metrics") - gomega.Eventually(ctx, getCPUManagerMetrics, 1*time.Minute, 15*time.Second).Should(matchResourceMetrics) + gomega.Eventually(ctx, getKubeletMetrics, 1*time.Minute, 15*time.Second).Should(matchResourceMetrics) ginkgo.By("Ensuring the metrics match the expectations a few more times") - gomega.Consistently(ctx, getCPUManagerMetrics, 1*time.Minute, 15*time.Second).Should(matchResourceMetrics) + gomega.Consistently(ctx, getKubeletMetrics, 1*time.Minute, 15*time.Second).Should(matchResourceMetrics) }) }) }) -func getCPUManagerMetrics(ctx context.Context) (e2emetrics.KubeletMetrics, error) { - // we are running out of good names, so we need to be unnecessarily specific to avoid clashes - ginkgo.By("getting CPU Manager metrics from the metrics API") +func getKubeletMetrics(ctx context.Context) (e2emetrics.KubeletMetrics, error) { + ginkgo.By("getting Kubelet metrics from the metrics API") return e2emetrics.GrabKubeletMetricsWithoutProxy(ctx, framework.TestContext.NodeName+":10255", "/metrics") }