Avoid getting gofail/runtime when failpoints are disabled

Signed-off-by: Marek Siarkowicz <siarkowicz@google.com>
This commit is contained in:
Marek Siarkowicz 2022-11-15 16:15:59 +01:00
parent 8438ddae3e
commit ebf41c2d48

View File

@ -19,22 +19,24 @@ toggle_failpoints() {
mode="$1" mode="$1"
if command -v gofail >/dev/null 2>&1; then if command -v gofail >/dev/null 2>&1; then
run gofail "$mode" server/etcdserver/ server/storage/backend/ server/storage/mvcc/ run gofail "$mode" server/etcdserver/ server/storage/backend/ server/storage/mvcc/
( if [[ "$mode" == "enable" ]]; then
cd ./server (
run go get go.etcd.io/gofail/runtime cd ./server
) || exit 2 run go get go.etcd.io/gofail/runtime
( ) || exit 2
cd ./etcdutl (
run go get go.etcd.io/gofail/runtime cd ./etcdutl
) || exit 2 run go get go.etcd.io/gofail/runtime
( ) || exit 2
cd ./etcdctl (
run go get go.etcd.io/gofail/runtime cd ./etcdctl
) || exit 2 run go get go.etcd.io/gofail/runtime
( ) || exit 2
cd ./tests (
run go get go.etcd.io/gofail/runtime cd ./tests
) || exit 2 run go get go.etcd.io/gofail/runtime
) || exit 2
fi
elif [[ "$mode" != "disable" ]]; then elif [[ "$mode" != "disable" ]]; then
log_error "FAILPOINTS set but gofail not found" log_error "FAILPOINTS set but gofail not found"
exit 1 exit 1