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.
This commit is contained in:
parent
38cf3a0972
commit
e2b96bb877
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user