From 5d352439d4b2ffba9510d47e05fcd56b413d9f45 Mon Sep 17 00:00:00 2001 From: David Ashpole Date: Fri, 16 Dec 2016 11:50:43 -0800 Subject: [PATCH] test no longer fails when it fails to get the summary --- test/e2e_node/inode_eviction_test.go | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/test/e2e_node/inode_eviction_test.go b/test/e2e_node/inode_eviction_test.go index a3be5cc915..1e5a8aff38 100644 --- a/test/e2e_node/inode_eviction_test.go +++ b/test/e2e_node/inode_eviction_test.go @@ -146,7 +146,9 @@ func runEvictionTest(f *framework.Framework, testCondition string, podTestSpecs It(fmt.Sprintf("should eventually see %s, and then evict all of the correct pods", testCondition), func() { Eventually(func() error { hasPressure, err := hasPressureCondition(f, testCondition) - framework.ExpectNoError(err, fmt.Sprintf("checking if we have %s", testCondition)) + if err != nil { + return err + } if hasPressure { return nil } @@ -161,7 +163,9 @@ func runEvictionTest(f *framework.Framework, testCondition string, podTestSpecs framework.Logf("fetching pod %s; phase= %v", p.Name, p.Status.Phase) } _, err = hasPressureCondition(f, testCondition) - framework.ExpectNoError(err, fmt.Sprintf("checking if we have %s", testCondition)) + if err != nil { + return err + } By("checking eviction ordering and ensuring important pods dont fail") done := true @@ -216,7 +220,9 @@ func runEvictionTest(f *framework.Framework, testCondition string, podTestSpecs By("making sure conditions eventually return to normal") Eventually(func() error { hasPressure, err := hasPressureCondition(f, testCondition) - framework.ExpectNoError(err, fmt.Sprintf("checking if we have %s", testCondition)) + if err != nil { + return err + } if hasPressure { return fmt.Errorf("Conditions havent returned to normal, we still have %s", testCondition) } @@ -226,7 +232,12 @@ func runEvictionTest(f *framework.Framework, testCondition string, podTestSpecs By("making sure conditions do not return") Consistently(func() error { hasPressure, err := hasPressureCondition(f, testCondition) - framework.ExpectNoError(err, fmt.Sprintf("checking if we have %s", testCondition)) + if err != nil { + // Race conditions sometimes occur when checking pressure condition due to #38710 (Docker bug) + // Do not fail the test when this occurs, since this is expected to happen occasionally. + framework.Logf("Failed to check pressure condition. Error: %v", err) + return nil + } if hasPressure { return fmt.Errorf("%s dissappeared and then reappeared", testCondition) }