From b798df8c4480fe0bd78bc929d7d7aa8bc7532e83 Mon Sep 17 00:00:00 2001 From: David Ashpole Date: Thu, 23 Feb 2017 11:52:25 -0800 Subject: [PATCH] check that innocent pod survives after evictions --- test/e2e_node/inode_eviction_test.go | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/test/e2e_node/inode_eviction_test.go b/test/e2e_node/inode_eviction_test.go index 2fe20b388e0..8ad63de1334 100644 --- a/test/e2e_node/inode_eviction_test.go +++ b/test/e2e_node/inode_eviction_test.go @@ -233,7 +233,7 @@ func runEvictionTest(f *framework.Framework, testCondition string, podTestSpecs return nil }, evictionTestTimeout, evictionPollInterval).Should(BeNil()) - By("making sure conditions do not return") + By("making sure conditions do not return, and that pods that shouldnt fail dont fail") Consistently(func() error { hasPressure, err := hasPressureCondition(f, testCondition) if err != nil { @@ -245,6 +245,18 @@ func runEvictionTest(f *framework.Framework, testCondition string, podTestSpecs if hasPressure { return fmt.Errorf("%s dissappeared and then reappeared", testCondition) } + // Gather current information + updatedPodList, _ := f.ClientSet.Core().Pods(f.Namespace.Name).List(metav1.ListOptions{}) + for _, priorityPodSpec := range podTestSpecs { + // EvictionPriority 0 pods should not fail + if priorityPodSpec.evictionPriority == 0 { + for _, p := range updatedPodList.Items { + if p.Name == priorityPodSpec.pod.Name && p.Status.Phase == v1.PodFailed { + return fmt.Errorf("%s pod failed (delayed) and shouldn't have failed", p.Name) + } + } + } + } return nil }, postTestConditionMonitoringPeriod, evictionPollInterval).Should(BeNil())