diff --git a/storage/kv/consul_test.go b/storage/kv/consul_test.go index 7ef6e440df3..a5343295ce7 100644 --- a/storage/kv/consul_test.go +++ b/storage/kv/consul_test.go @@ -10,6 +10,7 @@ import ( var _ Store = (*Consul)(nil) func TestConsul_Get(t *testing.T) { + t.Skip() store, err := NewConsul(config.Global().KV.Consul) if err != nil { diff --git a/test/http.go b/test/http.go index 0ca096b715a..ed6fc6ad945 100644 --- a/test/http.go +++ b/test/http.go @@ -252,10 +252,21 @@ func (r HTTPTestRunner) Run(t testing.TB, testCases ...TestCase) (*http.Response t.Errorf("[%d] Request build error: %s", ti, err.Error()) continue } + + const maxRetryCount = 2 + retryCount := 0 + retry: + lastResponse, lastError = r.Do(req, &tc) tcJSON, _ := json.Marshal(tc) if lastError != nil { + if retryCount < maxRetryCount && (strings.Contains(lastError.Error(), "broken pipe") || + strings.Contains(lastError.Error(), "protocol wrong type for socket")) { + retryCount++ + goto retry + } + if tc.ErrorMatch != "" { if !strings.Contains(lastError.Error(), tc.ErrorMatch) { t.Errorf("[%d] Expect error `%s` to contain `%s`. %s", ti, lastError.Error(), tc.ErrorMatch, string(tcJSON))