Skip to content

Commit

Permalink
Fixes for compatibility with Go 1.16 (uber#821)
Browse files Browse the repository at this point in the history
Ref https://golang.org/doc/go1.16#go-command

go modules are now enabled by default, so go get would fail
without explicitly turning it off via GO111MODULE=off

additionally, go build -i now returns an error during tests. since
that flag has been deprecated, remove it so the tests can pass.
cinchurge authored Mar 12, 2021

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
1 parent 61d863a commit 7e7465b
Showing 4 changed files with 20 additions and 6 deletions.
8 changes: 4 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -6,19 +6,19 @@ cache:
- $HOME/.glide/cache

go:
- 1.13.x
- 1.14.x
- oldstable
- stable

matrix:
include:
- go: 1.13.x
- go: stable
env: CROSSDOCK=true
sudo: required
dist: trusty
services:
- docker
include:
- go: 1.13.x
- go: stable
env: NO_TEST=yes COVERAGE=yes LINT=yes

env:
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
export GO15VENDOREXPERIMENT=1
export GO111MODULE=off

PATH := $(GOPATH)/bin:$(PATH)
EXAMPLES=./examples/bench/server ./examples/bench/client ./examples/ping ./examples/thrift ./examples/hyperbahn/echo-server
15 changes: 14 additions & 1 deletion relay_benchmark_test.go
Original file line number Diff line number Diff line change
@@ -118,8 +118,15 @@ func benchmarkRelay(b *testing.B, p benchmarkParams) {
wc := newWorkerControl(p.clients)
dec := testutils.Decrementor(b.N)

var wg sync.WaitGroup
errC := make(chan error, 1)
defer close(errC)

for i, c := range clients {
wg.Add(1)
go func(i int, c benchmark.Client) {
defer wg.Done()

// Do a warm up call.
c.RawCall(1)

@@ -134,7 +141,8 @@ func benchmarkRelay(b *testing.B, p benchmarkParams) {

durations, err := c.RawCall(tokens)
if err != nil {
b.Fatalf("Call failed: %v", err)
errC <- err
return
}

for _, d := range durations {
@@ -144,6 +152,11 @@ func benchmarkRelay(b *testing.B, p benchmarkParams) {
}(i, c)
}

wg.Wait()
if err := <-errC; err != nil {
b.Fatalf("Call failed: %v", err)
}

var started time.Time
wc.WaitForStart(func() {
b.ResetTimer()
2 changes: 1 addition & 1 deletion thrift/thrift-gen/compile_test.go
Original file line number Diff line number Diff line change
@@ -325,7 +325,7 @@ func runTest(t *testing.T, opts processOptions, extraChecks func(string) error)
}

// Run go build to ensure that the generated code builds.
cmd := exec.Command("go", "build", "-i", "./...")
cmd := exec.Command("go", "build", "./...")
cmd.Dir = tempDir
// NOTE: we check output, since go build ./... returns 0 status code on failure:
// https://github.com/golang/go/issues/11407

0 comments on commit 7e7465b

Please sign in to comment.