From c92d9f7974f919776c2b58ee6eeb63849269cc1a Mon Sep 17 00:00:00 2001 From: Francesco Romani Date: Wed, 2 Feb 2022 13:59:20 +0100 Subject: [PATCH] e2e: node: {cpu,topo}mgr: don't assume cpu capacity >= 2 Even though CI machines _usually_ have at least two cpus, let's rather not assume this holds true, and let's actually check the allocatable CPUs, skipping even the simplest tests if the assumption is broken, to avoid false negatives. Signed-off-by: Francesco Romani --- test/e2e_node/topology_manager_test.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/test/e2e_node/topology_manager_test.go b/test/e2e_node/topology_manager_test.go index d6cd39ebf54..50b97be6c5a 100644 --- a/test/e2e_node/topology_manager_test.go +++ b/test/e2e_node/topology_manager_test.go @@ -342,6 +342,12 @@ func runTopologyManagerPolicySuiteTests(f *framework.Framework) { cpuCap, cpuAlloc, _ = getLocalNodeCPUDetails(f) ginkgo.By(fmt.Sprintf("checking node CPU capacity (%d) and allocatable CPUs (%d)", cpuCap, cpuAlloc)) + // Albeit even the weakest CI machines usually have 2 cpus, let's be extra careful and + // check explicitly. We prefer to skip than a false negative (and a failed test). + if cpuAlloc < 1 { + e2eskipper.Skipf("Skipping basic CPU Manager tests since CPU capacity < 2") + } + ginkgo.By("running a non-Gu pod") runNonGuPodTest(f, cpuCap)