From 086a500d8f3c89f2ff9e7507c2beed4c274669f9 Mon Sep 17 00:00:00 2001 From: Francesco Romani Date: Tue, 11 Jun 2024 17:14:03 +0200 Subject: [PATCH] e2e: node: use test owner tracking e2e_node test depend on very specific shared state (node state). Pod leakages between tests oftentimes cause the test preconditions to be silently corrupted, causing hard to debug CI failures. Use the new facility to annotate pods with test owner (= the test code which created the test) to help debug these failures. For more context, please check the conversation in #123468 Signed-off-by: Francesco Romani --- test/e2e_node/e2e_node_suite_test.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/test/e2e_node/e2e_node_suite_test.go b/test/e2e_node/e2e_node_suite_test.go index 5c622fae3ed..7b75394d3b7 100644 --- a/test/e2e_node/e2e_node_suite_test.go +++ b/test/e2e_node/e2e_node_suite_test.go @@ -44,6 +44,7 @@ import ( commontest "k8s.io/kubernetes/test/e2e/common" "k8s.io/kubernetes/test/e2e/framework" e2econfig "k8s.io/kubernetes/test/e2e/framework/config" + e2epod "k8s.io/kubernetes/test/e2e/framework/pod" e2eskipper "k8s.io/kubernetes/test/e2e/framework/skipper" e2etestfiles "k8s.io/kubernetes/test/e2e/framework/testfiles" e2etestingmanifests "k8s.io/kubernetes/test/e2e/testing-manifests" @@ -213,6 +214,11 @@ func TestE2eNode(t *testing.T) { klog.Errorf("Failed creating report directory: %v", err) } } + + // annotate created pods with source code location to make it easier to find tests + // which do insufficient cleanup and pollute the node state with lingering pods + e2epod.GlobalOwnerTracking = true + suiteConfig, reporterConfig := framework.CreateGinkgoConfig() ginkgo.RunSpecs(t, "E2eNode Suite", suiteConfig, reporterConfig) }