Enable race detection in ci (#259)

We previously did not have race detection enabled because our tests
would fail. Following #249, this is no longer the case.

Enable race detection in ci and build instructions. This change also
fixes client_test.go attempting to allocate a 2GB buffer due to bad test
input.

Fixes #173

Signed-off-by: Andrew Seigner <siggy@buoyant.io>
This commit is contained in:
Andrew Seigner 2018-02-02 15:04:52 -08:00 committed by GitHub
parent 9cadb30795
commit 4156af786d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 3 additions and 5 deletions

View File

@ -40,7 +40,7 @@ jobs:
# TODO decide whether protoc should be committed or not. If so, we shouldn't do
# this or we should error if it dirties the repo.
- ./bin/protoc-go.sh
- go test -v ./...
- go test -race -v ./...
- go vet ./...
- language: node_js

View File

@ -183,7 +183,7 @@ bin/go-run controller/script/simulate-proxy --kubeconfig ~/.kube/config --addr $
```bash
bin/dep ensure
go test ./...
go test -race ./...
go vet ./...
```

View File

@ -7,7 +7,6 @@ import (
"io/ioutil"
"net/http"
"net/url"
"strings"
"testing"
"time"
@ -31,7 +30,7 @@ func TestNewInternalClient(t *testing.T) {
mockTransport := &mockTransport{}
mockTransport.responseToReturn = &http.Response{
StatusCode: 500,
Body: ioutil.NopCloser(strings.NewReader("body")),
Body: ioutil.NopCloser(bufferedReader(t, &pb.Empty{})),
}
mockHttpClient := &http.Client{
Transport: mockTransport,
@ -42,7 +41,6 @@ func TestNewInternalClient(t *testing.T) {
Host: "some-hostname",
Path: "/",
}
client, err := newClient(apiURL, mockHttpClient)
if err != nil {
t.Fatalf("Unexpected error: %v", err)