From 4f3e3c627830a3a18226482f90e75b3fd0d63933 Mon Sep 17 00:00:00 2001 From: Shyam Jeedigunta Date: Wed, 13 Sep 2017 15:17:37 +0200 Subject: [PATCH] Don't crash density test on missing a single measurement --- test/e2e/scalability/density.go | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/test/e2e/scalability/density.go b/test/e2e/scalability/density.go index 1165b07c4e9..d241ee9d06e 100644 --- a/test/e2e/scalability/density.go +++ b/test/e2e/scalability/density.go @@ -58,6 +58,9 @@ const ( // Maximum container failures this test tolerates before failing. var MaxContainerFailures = 0 +// Maximum no. of missing measurements related to pod-startup that the test tolerates. +var MaxMissingPodStartupMeasurements = 0 + type DensityTestConfig struct { Configs []testutils.RunObjectConfig ClientSets []clientset.Interface @@ -310,6 +313,7 @@ var _ = SIGDescribe("Density", func() { var masters sets.String testCaseBaseName := "density" + missingMeasurements := 0 // Gathers data prior to framework namespace teardown AfterEach(func() { @@ -345,6 +349,9 @@ var _ = SIGDescribe("Density", func() { } framework.PrintSummaries(summaries, testCaseBaseName) + + // Fail if more than the allowed threshold of measurements were missing in the latencyTest. + Expect(missingMeasurements <= MaxMissingPodStartupMeasurements).To(Equal(true)) }) options := framework.FrameworkOptions{ @@ -717,23 +724,23 @@ var _ = SIGDescribe("Density", func() { sched, ok := scheduleTimes[name] if !ok { framework.Logf("Failed to find schedule time for %v", name) + missingMeasurements++ } - Expect(ok).To(Equal(true)) run, ok := runTimes[name] if !ok { framework.Logf("Failed to find run time for %v", name) + missingMeasurements++ } - Expect(ok).To(Equal(true)) watch, ok := watchTimes[name] if !ok { framework.Logf("Failed to find watch time for %v", name) + missingMeasurements++ } - Expect(ok).To(Equal(true)) node, ok := nodeNames[name] if !ok { framework.Logf("Failed to find node for %v", name) + missingMeasurements++ } - Expect(ok).To(Equal(true)) scheduleLag = append(scheduleLag, framework.PodLatencyData{Name: name, Node: node, Latency: sched.Time.Sub(create.Time)}) startupLag = append(startupLag, framework.PodLatencyData{Name: name, Node: node, Latency: run.Time.Sub(sched.Time)})