Change:
https://k8s- Failed: [] Container Lifecycle Hook when create a pod with lifecycle hook when it is http hook should execute poststart http hook properly {E2eNode Suite}
https://k8s- Failed: [] Container Lifecycle Hook when create a pod with lifecycle hook when it is http hook should execute poststart http hook properly {E2eNode Suite}
https://k8s- Failed: [] Container Lifecycle Hook when create a pod with lifecycle hook when it is http hook should execute poststart http hook properly {E2eNode Suite}
https://k8s- Failed: [] Container Lifecycle Hook when create a pod with lifecycle hook when it is http hook should execute poststart http hook properly {E2eNode Suite}
[FLAKE-PING] This flaky-test issue would love to have more attention.
https://k8s- Failed: [] Container Lifecycle Hook when create a pod with lifecycle hook when it is http hook should execute poststart http hook properly {E2eNode Suite} Happened on a presubmit run in .
[FLAKE-PING] This flaky-test issue would love to have more attention.
[FLAKE-PING] This flaky-test issue would love to have more attention.
https://k8s- Failed: [] Container Lifecycle Hook when create a pod with lifecycle hook when it is http hook should execute poststart http hook properly {E2eNode Suite} Happened on a presubmit run in .
[FLAKE-PING] This flaky-test issue would love to have more attention.
[FLAKE-PING] This flaky-test issue would love to have more attention.
[FLAKE-PING] This flaky-test issue would love to have more attention.
[FLAKE-PING] This flaky-test issue would love to have more attention.
[FLAKE-PING] This flaky-test issue would love to have more attention.
https://k8s- Failed: [] Container Lifecycle Hook when create a pod with lifecycle hook when it is http hook should execute poststart http hook properly {E2eNode Suite}
[FLAKE-PING] This flaky-test issue would love to have more attention.
[FLAKE-PING] This flaky-test issue would love to have more attention.
[FLAKE-PING] This flaky-test issue would love to have more attention.
[FLAKE-PING] This flaky-test issue would love to have more attention.
[FLAKE-PING] This flaky-test issue would love to have more attention.
https://k8s- Failed: [] Container Lifecycle Hook when create a pod with lifecycle hook when it is http hook should execute poststart http hook properly {E2eNode Suite}
[FLAKE-PING] This flaky-test issue would love to have more attention.
[FLAKE-PING] This flaky-test issue would love to have more attention.
https://k8s- Failed: [] Container Lifecycle Hook when create a pod with lifecycle hook when it is http hook should execute poststart http hook properly {E2eNode Suite}
[FLAKE-PING] This flaky-test issue would love to have more attention.
[FLAKE-PING] This flaky-test issue would love to have more attention.
the for this issue looks pretty good. We could probably close this issue.
[FLAKE-PING] This flaky-test issue would love to have more attention.
https://k8s- Failed: [] Container Lifecycle Hook when create a pod with lifecycle hook when it is http hook should execute poststart http hook properly {E2eNode Suite}
[FLAKE-PING] This flaky-test issue would love to have more attention.
Looks like more recent flakes:
[FLAKE-PING] This flaky-test issue would love to have more attention.
[FLAKE-PING] This flaky-test issue would love to have more attention.
[FLAKE-PING] This flaky-test issue would love to have more attention.
[FLAKE-PING] This flaky-test issue would love to have more attention.
Adding labels for team node as is failure is part of the node e2e tests. All issues must be labeled either release blocker or non release blocking by end of day 18 November 2016 PST. Given the test flakes very infrequently and doesn't seem to be associated with a particular code change Could either or someone from please advise as to whether you believe this issue is actually a release blocker and I'll update the issue. Any updates from you would also be greatly appreciated.Thanks! cc:
The test was introduced by which causes some flakiness: Re-assign this to Lantao, I think the issue should be in the test itself, and non-resource-blocker. But I temporarily marked it as release blocker after your triage. Thanks!
This is a issue in the test itself. I've sent a fix for this
[FLAKE-PING] This flaky-test issue would love to have more attention.
[FLAKE-PING] This flaky-test issue would love to have more attention.

Discussion:
import ( "fmt" <ins> "regexp" </ins> "sync" "time"

}, )).To(Succeed(), "wait for pod %q to success", name) } <ins> // MatchContainerOutput gest output of a container and match expected regexp in the output. func (c *PodClient) MatchContainerOutput(name string, containerName string, expectedRegexp string) error { f := c.f output, err := GetPodLogs(f.ClientSet, f.Namespace.Name, name, containerName) if err != nil { return fmt.Errorf("failed to get output for container %q of pod %q", containerName, name) } regex, err := regexp.Compile(expectedRegexp) if err != nil { return fmt.Errorf("failed to compile regexp %q: %v", expectedRegexp, err) } if !regex.MatchString(output) { return fmt.Errorf("failed to match regexp %q in output %q", expectedRegexp, output) } return nil } </ins>

"k8s.io/kubernetes/test/e2e/framework" . "github.com/onsi/ginkgo" <ins> . "github.com/onsi/gomega" </ins> ) var _ = framework.KubeDescribe("Container Lifecycle Hook", func() { f := framework.NewDefaultFramework("container-lifecycle-hook") var podClient *framework.PodClient <del> var file string const podWaitTimeout = 2 * time.Minute testPodWithHook := func(podWithHook *api.Pod) { podCheckHook := getLifecycleHookTestPod("pod-check-hook", // Wait until the file is created. []string{"sh", "-c", fmt.Sprintf("while [ ! -e %s ]; do sleep 1; done", file)}, ) By("create the pod with lifecycle hook") podClient.CreateSync(podWithHook) if podWithHook.Spec.Containers[0].Lifecycle.PostStart != nil { By("create the hook check pod") podClient.Create(podCheckHook) By("wait for the hook check pod to success") podClient.WaitForSuccess(podCheckHook.Name, podWaitTimeout) } By("delete the pod with lifecycle hook") podClient.DeleteSync(podWithHook.Name, api.NewDeleteOptions(15), podWaitTimeout) if podWithHook.Spec.Containers[0].Lifecycle.PreStop != nil { By("create the hook check pod") podClient.Create(podCheckHook) By("wait for the prestop check pod to success") podClient.WaitForSuccess(podCheckHook.Name, podWaitTimeout) } } </del> <ins> const ( podCheckInterval     = 1 * time.Second podWaitTimeout       = 2 * time.Minute postStartWaitTimeout = 2 * time.Minute preStopWaitTimeout   = 30 * time.Second ) </ins> Context("when create a pod with lifecycle hook", func() { BeforeEach(func() { podClient = f.PodClient() <del> file = "/tmp/test-" + string(uuid.NewUUID()) }) AfterEach(func() { By("cleanup the temporary file created in the test.") cleanupPod := getLifecycleHookTestPod("pod-clean-up", []string{"rm", file}) podClient.Create(cleanupPod) podClient.WaitForSuccess(cleanupPod.Name, podWaitTimeout) </del> }) Context("when it is exec hook", func() { <ins> var file string testPodWithExecHook := func(podWithHook *api.Pod) { podCheckHook := getExecHookTestPod("pod-check-hook", // Wait until the file is created. []string{"sh", "-c", fmt.Sprintf("while [ ! -e %s ]; do sleep 1; done", file)}, ) By("create the pod with lifecycle hook") podClient.CreateSync(podWithHook) if podWithHook.Spec.Containers[0].Lifecycle.PostStart != nil { By("create the hook check pod") podClient.Create(podCheckHook) By("wait for the hook check pod to success") podClient.WaitForSuccess(podCheckHook.Name, postStartWaitTimeout) } By("delete the pod with lifecycle hook") podClient.DeleteSync(podWithHook.Name, api.NewDeleteOptions(15), podWaitTimeout) if podWithHook.Spec.Containers[0].Lifecycle.PreStop != nil { By("create the hook check pod") podClient.Create(podCheckHook) By("wait for the prestop check pod to success") podClient.WaitForSuccess(podCheckHook.Name, preStopWaitTimeout) } } BeforeEach(func() { file = "/tmp/test-" + string(uuid.NewUUID()) }) AfterEach(func() { By("cleanup the temporary file created in the test.") cleanupPod := getExecHookTestPod("pod-clean-up", []string{"rm", file}) podClient.Create(cleanupPod) podClient.WaitForSuccess(cleanupPod.Name, podWaitTimeout) }) </ins> It("should execute poststart exec hook properly [Conformance]", func() { <del> podWithHook := getLifecycleHookTestPod("pod-with-poststart-exec-hook", </del> <ins> podWithHook := getExecHookTestPod("pod-with-poststart-exec-hook", </ins> // Block forever []string{"tail", "-f", "/dev/null"}, )

Exec: &api.ExecAction{Command: []string{"touch", file}}, }, } <del> testPodWithHook(podWithHook) </del> <ins> testPodWithExecHook(podWithHook) </ins> }) It("should execute prestop exec hook properly [Conformance]", func() { <del> podWithHook := getLifecycleHookTestPod("pod-with-prestop-exec-hook", </del> <ins> podWithHook := getExecHookTestPod("pod-with-prestop-exec-hook", </ins> // Block forever []string{"tail", "-f", "/dev/null"}, )

Exec: &api.ExecAction{Command: []string{"touch", file}}, }, } <del> testPodWithHook(podWithHook) </del> <ins> testPodWithExecHook(podWithHook) </ins> }) }) Context("when it is http hook", func() { var targetIP string <del> BeforeEach(func() { By("cleanup the container to handle the HTTPGet hook request.") podHandleHookRequest := getLifecycleHookTestPod("pod-handle-http-request", []string{"sh", "-c", // Create test file when receive request on 1234. fmt.Sprintf("echo -e "HTTP/1.1 200 OKn" | nc -l -p 1234; touch %s", file), }, ) podHandleHookRequest.Spec.Containers[0].Ports = []api.ContainerPort{ { ContainerPort: 1234, Protocol:      api.ProtocolTCP, </del> <ins> podHandleHookRequest := &api.Pod{ ObjectMeta: api.ObjectMeta{ Name: "pod-handle-http-request", }, Spec: api.PodSpec{ Containers: []api.Container{ { Name:  "pod-handle-http-request", Image: "gcr.io/google_containers/netexec:1.7", Ports: []api.ContainerPort{ { ContainerPort: 8080, Protocol:      api.ProtocolTCP, }, }, }, </ins> }, <del> } podHandleHookRequest = podClient.CreateSync(podHandleHookRequest) targetIP = podHandleHookRequest.Status.PodIP </del> <ins> }, } BeforeEach(func() { By("create the container to handle the HTTPGet hook request.") newPod := podClient.CreateSync(podHandleHookRequest) targetIP = newPod.Status.PodIP </ins> }) <ins> testPodWithHttpHook := func(podWithHook *api.Pod) { By("create the pod with lifecycle hook") podClient.CreateSync(podWithHook) if podWithHook.Spec.Containers[0].Lifecycle.PostStart != nil { By("check poststart hook") Eventually(func() error { return podClient.MatchContainerOutput(podHandleHookRequest.Name, podHandleHookRequest.Spec.Containers[0].Name, `GET /echo?msg=poststart`) }, postStartWaitTimeout, podCheckInterval).Should(BeNil()) } By("delete the pod with lifecycle hook") podClient.DeleteSync(podWithHook.Name, api.NewDeleteOptions(15), podWaitTimeout) if podWithHook.Spec.Containers[0].Lifecycle.PreStop != nil { By("check prestop hook") Eventually(func() error { return podClient.MatchContainerOutput(podHandleHookRequest.Name, podHandleHookRequest.Spec.Containers[0].Name, `GET /echo?msg=prestop`) }, preStopWaitTimeout, podCheckInterval).Should(BeNil()) } } </ins> It("should execute poststart http hook properly [Conformance]", func() { <del> podWithHook := getLifecycleHookTestPod("pod-with-poststart-http-hook", // Block forever []string{"tail", "-f", "/dev/null"}, ) podWithHook.Spec.Containers[0].Lifecycle = &api.Lifecycle{ PostStart: &api.Handler{ HTTPGet: &api.HTTPGetAction{ Host: targetIP, Port: intstr.FromInt(1234), </del> <ins> podWithHook := &api.Pod{ ObjectMeta: api.ObjectMeta{ Name: "pod-with-poststart-http-hook", }, Spec: api.PodSpec{ Containers: []api.Container{ { Name:  "pod-with-poststart-http-hook", Image: framework.GetPauseImageNameForHostArch(), Lifecycle: &api.Lifecycle{ PostStart: &api.Handler{ HTTPGet: &api.HTTPGetAction{ Path: "/echo?msg=poststart", Host: targetIP, Port: intstr.FromInt(8080), }, }, }, }, </ins> }, }, } <del> testPodWithHook(podWithHook) </del> <ins> testPodWithHttpHook(podWithHook) </ins> }) It("should execute prestop http hook properly [Conformance]", func() { <del> podWithHook := getLifecycleHookTestPod("pod-with-prestop-http-hook", // Block forever []string{"tail", "-f", "/dev/null"}, ) podWithHook.Spec.Containers[0].Lifecycle = &api.Lifecycle{ PreStop: &api.Handler{ HTTPGet: &api.HTTPGetAction{ Host: targetIP, Port: intstr.FromInt(1234), </del> <ins> podWithHook := &api.Pod{ ObjectMeta: api.ObjectMeta{ Name: "pod-with-prestop-http-hook", }, Spec: api.PodSpec{ Containers: []api.Container{ { Name:  "pod-with-prestop-http-hook", Image: framework.GetPauseImageNameForHostArch(), Lifecycle: &api.Lifecycle{ PreStop: &api.Handler{ HTTPGet: &api.HTTPGetAction{ Path: "/echo?msg=prestop", Host: targetIP, Port: intstr.FromInt(8080), }, }, }, }, </ins> }, }, } <del> testPodWithHook(podWithHook) </del> <ins> testPodWithHttpHook(podWithHook) </ins> }) }) }) }) <del> func getLifecycleHookTestPod(name string, cmd []string) *api.Pod { </del> <ins> func getExecHookTestPod(name string, cmd []string) *api.Pod { </ins> return &api.Pod{ ObjectMeta: api.ObjectMeta{ Name: name,