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 <fromani@redhat.com>
This commit is contained in:
Francesco Romani 2024-06-11 17:14:03 +02:00
parent 7160ef4fbc
commit 086a500d8f

View File

@ -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)
}