etcd/test.sh
Doug MacEachern d73390a674 fix(server): avoid race conditions in Run/Stop
- don't close ready channel until PeerServer is listening.
  avoids possible panic in Stop() if PeerServer is nil.

- avoid data race in Run() (err variable was shared between 2 goroutines)

- avoid data race in PeerServer Start/Stop (PeerServer.closeChan)
2014-04-15 09:24:54 -07:00

41 lines
767 B
Bash
Executable File

#!/bin/sh -e
. ./build
go test -i ./etcd
go test -v ./etcd -race
go test -i ./http
go test -v ./http -race
go test -i ./store
go test -v ./store -race
go test -i ./server
go test -v ./server -race
go test -i ./config
go test -v ./config -race
go test -i ./server/v1/tests
go test -v ./server/v1/tests -race
go test -i ./server/v2/tests
go test -v ./server/v2/tests -race
go test -i ./mod/lock/v2/tests
go test -v ./mod/lock/v2/tests
go test -i ./pkg/btrfs
go test -v ./pkg/btrfs
go test -i ./tests/functional
ETCD_BIN_PATH=$(pwd)/bin/etcd go test -v ./tests/functional -race
fmtRes=`gofmt -l $GOFMTPATH`
if [ "$fmtRes" != "" ]; then
echo "Failed to pass golang format checking."
echo "Please gofmt modified go files, or run './build --fmt'."
exit 1
fi