mirror of https://github.com/linkerd/linkerd2.git
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:
parent
9cadb30795
commit
4156af786d
|
@ -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
|
||||
|
|
2
BUILD.md
2
BUILD.md
|
@ -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 ./...
|
||||
```
|
||||
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue