Skip to content

Commit 086a500

Browse files
committed
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 kubernetes#123468 Signed-off-by: Francesco Romani <[email protected]>
1 parent 7160ef4 commit 086a500

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

test/e2e_node/e2e_node_suite_test.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ import (
4444
commontest "k8s.io/kubernetes/test/e2e/common"
4545
"k8s.io/kubernetes/test/e2e/framework"
4646
e2econfig "k8s.io/kubernetes/test/e2e/framework/config"
47+
e2epod "k8s.io/kubernetes/test/e2e/framework/pod"
4748
e2eskipper "k8s.io/kubernetes/test/e2e/framework/skipper"
4849
e2etestfiles "k8s.io/kubernetes/test/e2e/framework/testfiles"
4950
e2etestingmanifests "k8s.io/kubernetes/test/e2e/testing-manifests"
@@ -213,6 +214,11 @@ func TestE2eNode(t *testing.T) {
213214
klog.Errorf("Failed creating report directory: %v", err)
214215
}
215216
}
217+
218+
// annotate created pods with source code location to make it easier to find tests
219+
// which do insufficient cleanup and pollute the node state with lingering pods
220+
e2epod.GlobalOwnerTracking = true
221+
216222
suiteConfig, reporterConfig := framework.CreateGinkgoConfig()
217223
ginkgo.RunSpecs(t, "E2eNode Suite", suiteConfig, reporterConfig)
218224
}

0 commit comments

Comments
 (0)