Merge pull request #5086 from heyitsanthony/test-race-rafthttp

test: check races on rafthttp
release-3.0
Anthony Romano 2016-04-14 14:21:20 -07:00
commit f2e915f56e
1 changed files with 2 additions and 9 deletions

11
test
View File

@ -28,16 +28,12 @@ ln -s ${PWD}/cmd/vendor $GOPATH/src
# Hack: gofmt ./ will recursively check the .git directory. So use *.go for gofmt.
PKGS=`ls pkg/*/*go | cut -f1,2 -d/ | sort | uniq`
TESTABLE_AND_FORMATTABLE="client clientv3 discovery error etcdctl/ctlv2 etcdctl/ctlv3 etcdmain etcdserver etcdserver/auth etcdserver/api/v2http etcdserver/api/v2http/httptypes $PKGS proxy/httpproxy proxy/tcpproxy raft snap storage storage/backend store version wal"
# TODO: add it to race testing when the issue is resolved
# https://github.com/golang/go/issues/9946
NO_RACE_TESTABLE="rafthttp"
FORMATTABLE="$TESTABLE_AND_FORMATTABLE $NO_RACE_TESTABLE *.go etcdctl/ integration clientv3/integration e2e alarm"
TESTABLE_AND_FORMATTABLE="client clientv3 discovery error etcdctl/ctlv2 etcdctl/ctlv3 etcdmain etcdserver etcdserver/auth etcdserver/api/v2http etcdserver/api/v2http/httptypes $PKGS proxy/httpproxy proxy/tcpproxy raft snap storage storage/backend store version wal rafthttp"
FORMATTABLE="$TESTABLE_AND_FORMATTABLE *.go etcdctl/ integration clientv3/integration e2e alarm"
# user has not provided PKG override
if [ -z "$PKG" ]; then
TEST=$TESTABLE_AND_FORMATTABLE
NO_RACE_TEST=$NO_RACE_TESTABLE
FMT=$FORMATTABLE
# user has provided PKG override
@ -54,8 +50,6 @@ fi
# split TEST into an array and prepend REPO_PATH to each local package
split=(${TEST// / })
TEST=${split[@]/#/${REPO_PATH}/}
split=(${NO_RACE_TEST// / })
NO_RACE_TEST=${split[@]/#/${REPO_PATH}/}
MACHINE_TYPE=$(uname -m)
if [ $MACHINE_TYPE != "armv7l" ]; then
RACE="--race"
@ -64,7 +58,6 @@ fi
function unit_tests {
echo "Running tests..."
go test -timeout 3m ${COVER} ${RACE} -cpu 1,2,4 $@ ${TEST}
go test -timeout 3m ${COVER} -cpu 1,2,4 $@ ${NO_RACE_TEST}
}
function integration_tests {