Skip to content

Commit

Permalink
Merge pull request #19213 from tschottdorf/flake/healthapi-19469
Browse files Browse the repository at this point in the history
server: de-flake TestHealthAPI
  • Loading branch information
tbg authored Oct 12, 2017
2 parents 05dc81d + c6bcb70 commit e43f68f
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions pkg/server/admin_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1096,8 +1096,22 @@ func TestHealthAPI(t *testing.T) {
// cannot verify the authentication session.
expected := "500 Internal Server Error"
var resp serverpb.HealthResponse
if err := getAdminJSONProto(s, "health", &resp); !testutils.IsError(err, expected) {
t.Errorf("expected %q error, got %v", expected, err)
for {
if err := getAdminJSONProto(s, "health", &resp); !testutils.IsError(err, expected) {
type timeouter interface {
Timeout() bool
}
if _, ok := err.(timeouter); ok {
// Special case for `*http.httpError` which can happen since we
// have timeouts on our requests and things may not be going so smoothly
// on the server side. See:
// https://github.com/cockroachdb/cockroach/issues/18469
log.Warningf(context.Background(), "ignoring timeout error: %s (%T)", err, err)
continue
}
t.Errorf("expected %q error, got %v (%T)", expected, err, err)
}
break
}
}

Expand Down

0 comments on commit e43f68f

Please sign in to comment.