From 7656ffeec663e732c64ee71f5958f50c54b90707 Mon Sep 17 00:00:00 2001 From: "Tim St. Clair" Date: Mon, 24 Oct 2016 13:47:16 -0700 Subject: [PATCH] Log failed containers after summary e2e test --- test/e2e_node/summary_test.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/test/e2e_node/summary_test.go b/test/e2e_node/summary_test.go index 75cb33dbd09..1190fa3b6f5 100644 --- a/test/e2e_node/summary_test.go +++ b/test/e2e_node/summary_test.go @@ -35,6 +35,11 @@ import ( var _ = framework.KubeDescribe("Summary API", func() { f := framework.NewDefaultFramework("summary-test") Context("when querying /stats/summary", func() { + AfterEach(func() { + if CurrentGinkgoTestDescription().Failed && framework.TestContext.DumpLogsOnFailure { + framework.LogFailedContainers(f.ClientSet, f.Namespace.Name, framework.Logf) + } + }) It("should report resource usage through the stats api", func() { const pod0 = "stats-busybox-0" const pod1 = "stats-busybox-1" @@ -214,7 +219,7 @@ func createSummaryTestPods(f *framework.Framework, names ...string) { { Name: "busybox-container", Image: "gcr.io/google_containers/busybox:1.24", - Command: []string{"sh", "-c", "ping -c 1 google.com; while true; do echo 'hello world' | tee /test-empty-dir-mnt/file ; sleep 1; done"}, + Command: []string{"sh", "-c", "ping -c 1 google.com; while true; do echo 'hello world' >> /test-empty-dir-mnt/file ; sleep 1; done"}, Resources: api.ResourceRequirements{ Limits: api.ResourceList{ // Must set memory limit to get MemoryStats.AvailableBytes