travis: fix GOARCH=386 and add misspell check (#1658)

- Define env variable RUN386 and set GOARCH later, instead of assigning to GOARCH directly. Otherwise, gimme will override GOARCH back
- Add misspell check
- Disable -race on 386
This commit is contained in:
Menghan Li
2017-11-08 13:40:05 -08:00
committed by GitHub
parent abd3e10d78
commit ebefec97dd
5 changed files with 9 additions and 5 deletions

View File

@ -9,7 +9,7 @@ go:
matrix: matrix:
include: include:
- go: 1.9.x - go: 1.9.x
env: GOARCH=386 env: RUN386=1
go_import_path: google.golang.org/grpc go_import_path: google.golang.org/grpc
@ -17,5 +17,7 @@ before_install:
- if [[ "$TRAVIS_GO_VERSION" = 1.9* && "$GOARCH" != "386" ]]; then ./vet.sh -install || exit 1; fi - if [[ "$TRAVIS_GO_VERSION" = 1.9* && "$GOARCH" != "386" ]]; then ./vet.sh -install || exit 1; fi
script: script:
- if [[ -n "$RUN386" ]]; then export GOARCH=386; fi
- if [[ "$TRAVIS_GO_VERSION" = 1.9* && "$GOARCH" != "386" ]]; then ./vet.sh || exit 1; fi - if [[ "$TRAVIS_GO_VERSION" = 1.9* && "$GOARCH" != "386" ]]; then ./vet.sh || exit 1; fi
- make test testrace - make test || exit 1
- if [[ "$GOARCH" != "386" ]]; then make testrace; fi

View File

@ -156,7 +156,7 @@ func (qb *quotaPool) add(v int) {
func (qb *quotaPool) lockedAdd(v int) { func (qb *quotaPool) lockedAdd(v int) {
var wakeUp bool var wakeUp bool
if qb.quota <= 0 { if qb.quota <= 0 {
wakeUp = true // Wake up potential watiers. wakeUp = true // Wake up potential waiters.
} }
qb.quota += v qb.quota += v
if wakeUp && qb.quota > 0 { if wakeUp && qb.quota > 0 {

View File

@ -985,7 +985,7 @@ func (t *http2Client) handleGoAway(f *http2.GoAwayFrame) {
t.Close() t.Close()
return return
} }
// A client can recieve multiple GoAways from the server (see // A client can receive multiple GoAways from the server (see
// https://github.com/grpc/grpc-go/issues/1387). The idea is that the first // https://github.com/grpc/grpc-go/issues/1387). The idea is that the first
// GoAway will be sent with an ID of MaxInt32 and the second GoAway will be // GoAway will be sent with an ID of MaxInt32 and the second GoAway will be
// sent after an RTT delay with the ID of the last stream the server will // sent after an RTT delay with the ID of the last stream the server will

View File

@ -1103,7 +1103,7 @@ func TestMaxStreams(t *testing.T) {
} }
} }
}() }()
// Test these conditions untill they pass or // Test these conditions until they pass or
// we reach the deadline (failure case). // we reach the deadline (failure case).
for { for {
select { select {

2
vet.sh
View File

@ -22,6 +22,7 @@ if [ "$1" = "-install" ]; then
github.com/golang/lint/golint \ github.com/golang/lint/golint \
golang.org/x/tools/cmd/goimports \ golang.org/x/tools/cmd/goimports \
honnef.co/go/tools/cmd/staticcheck \ honnef.co/go/tools/cmd/staticcheck \
github.com/client9/misspell/cmd/misspell \
github.com/golang/protobuf/protoc-gen-go \ github.com/golang/protobuf/protoc-gen-go \
golang.org/x/tools/cmd/stringer golang.org/x/tools/cmd/stringer
if [[ "$check_proto" = "true" ]]; then if [[ "$check_proto" = "true" ]]; then
@ -76,3 +77,4 @@ fi
# TODO(menghanl): fix errors in transport_test. # TODO(menghanl): fix errors in transport_test.
staticcheck -ignore google.golang.org/grpc/transport/transport_test.go:SA2002 ./... staticcheck -ignore google.golang.org/grpc/transport/transport_test.go:SA2002 ./...
misspell -error .