From 8c35e32a4020bd149bac1d4ca12953a0716e52bd Mon Sep 17 00:00:00 2001 From: Clayton Coleman Date: Thu, 5 Mar 2020 14:19:22 -0500 Subject: [PATCH] test: Properly detect container runtime flake in e2e test The condition was not part of the message and so would not match: OCI runtime create failed: container_linux.go:349: starting container process caused "process_linux.go:449: container init caused \"rootfs_linux.go:58: mounting \\\"/var/lib/kubelet/pods/128aea1f-bde3-43d5-8b5f-dd86b9a5ef33/volumes/kubernetes.io~secret/default-token-v55hm\\\" to rootfs \\\"/var/lib/docker/overlay2/813487ba91d534ded546ae34f2a05e7d94c26bd015d356f9b2641522d8f0d6da/merged\\\" at \\\"/var/run/secrets/kubernetes.io/serviceaccount\\\" caused \\\"stat /var/lib/kubelet/pods/128aea1f-bde3-43d5-8b5f-dd86b9a5ef33/volumes/kubernetes.io~secret/default-token-v55hm: no such file or directory\\\"\"": unknown Updated the check and regex. --- test/e2e/node/pods.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/e2e/node/pods.go b/test/e2e/node/pods.go index 4f2a023ee23..04e76695f96 100644 --- a/test/e2e/node/pods.go +++ b/test/e2e/node/pods.go @@ -213,7 +213,7 @@ var _ = SIGDescribe("Pods Extended", func() { ginkgo.It("should never report success for a pending container", func() { ginkgo.By("creating pods that should always exit 1 and terminating the pod after a random delay") - var reBug88766 = regexp.MustCompile(`ContainerCannotRun.*rootfs_linux\.go.*kubernetes\.io~secret.*no such file or directory`) + var reBug88766 = regexp.MustCompile(`rootfs_linux.*kubernetes\.io~secret.*no such file or directory`) var ( lock sync.Mutex @@ -350,7 +350,7 @@ var _ = SIGDescribe("Pods Extended", func() { switch { case t.ExitCode == 1: // expected - case t.ExitCode == 128 && reBug88766.MatchString(t.Message): + case t.ExitCode == 128 && t.Reason == "ContainerCannotRun" && reBug88766.MatchString(t.Message): // pod volume teardown races with container start in CRI, which reports a failure framework.Logf("pod %s on node %s failed with the symptoms of https://github.com/kubernetes/kubernetes/issues/88766") default: