From e2b96bb8779ad6b5e35c12bd638e704e9e75cd74 Mon Sep 17 00:00:00 2001 From: Phillip Wittrock Date: Mon, 4 Jan 2016 14:42:44 -0800 Subject: [PATCH] Only retry whitelisted test failure flakes instead of retrying on any failure. We should explicitly be retrying on certain conditions and not blindly doing so. --- integration/runner/runner.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/integration/runner/runner.go b/integration/runner/runner.go index 3a7e52e3..4bb610c3 100644 --- a/integration/runner/runner.go +++ b/integration/runner/runner.go @@ -23,6 +23,7 @@ import ( "os" "os/exec" "path" + "regexp" "strconv" "strings" "sync" @@ -117,6 +118,9 @@ func PushAndRunTests(host, testDir string) error { // Run the tests in a retry loop. glog.Infof("Running integration tests targeting %q...", host) + + // Only retry on test failures caused by these known flaky failure conditions + retryRegex := regexp.MustCompile("Network tx and rx bytes should not be equal") for i := 0; i <= *testRetryCount; i++ { // Check if this is a retry if i > 0 { @@ -129,6 +133,10 @@ func PushAndRunTests(host, testDir string) error { // On success, break out of retry loop break } + if !retryRegex.Match([]byte(err.Error())) { + // If error not in whitelist, break out of loop + break + } } if err != nil { err = fmt.Errorf("error on host %s: %v", host, err)