Log failed containers after summary e2e test

This commit is contained in:
Tim St. Clair 2016-10-24 13:47:16 -07:00
parent 33ebe1f18b
commit 7656ffeec6
No known key found for this signature in database
GPG Key ID: 434D16BCEF479EAB

View File

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