Browse Source

test: add race detection to clientv3 integration tests

Anthony Romano 9 years ago
parent
commit
47db0a2f2e
1 changed files with 5 additions and 6 deletions
  1. 5 6
      test

+ 5 - 6
test

@@ -45,14 +45,13 @@ 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"
+fi
 
 function unit_tests {
 	echo "Running tests..."
-
-	MACHINE_TYPE=$(uname -m)
-	if [ $MACHINE_TYPE != "armv7l" ]; then
-		RACE="--race"
-	fi
 	go test -timeout 3m ${COVER} ${RACE} -cpu 1,2,4 $@ ${TEST}
 	go test -timeout 3m ${COVER} -cpu 1,2,4 $@ ${NO_RACE_TEST}
 }
@@ -61,7 +60,7 @@ function integration_tests {
 	echo "Running integration tests..."
 	go test -timeout 10m -v -cpu 1,2,4 $@ ${REPO_PATH}/e2e
 	go test -timeout 15m -v -cpu 1,2,4 $@ ${REPO_PATH}/integration
-	go test -timeout 10m -v -cpu 1,2,4 $@ ${REPO_PATH}/clientv3/integration
+	go test -timeout 10m -v ${RACE} -cpu 1,2,4 $@ ${REPO_PATH}/clientv3/integration
 	go test -timeout 1m -v -cpu 1,2,4 $@ ${REPO_PATH}/contrib/raftexample
 }