diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 117bba5c614..e59c2865c05 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -38,13 +38,16 @@ jobs: GOARCH=amd64 PASSES='fmt bom dep' ./test ;; linux-amd64-integration-1-cpu) - GOARCH=amd64 CPU=1 RACE='false' make test-integration + make install-gofail + GOARCH=amd64 CPU=1 RACE='false' FAILPOINTS='true' make test-integration ;; linux-amd64-integration-2-cpu) - GOARCH=amd64 CPU=2 RACE='false' make test-integration + make install-gofail + GOARCH=amd64 CPU=2 RACE='false' FAILPOINTS='true' make test-integration ;; linux-amd64-integration-4-cpu) - GOARCH=amd64 CPU=4 RACE='false' make test-integration + make install-gofail + GOARCH=amd64 CPU=4 RACE='false' FAILPOINTS='true' make test-integration ;; linux-amd64-functional) ./build && GOARCH=amd64 PASSES='functional' ./test diff --git a/Makefile b/Makefile index 0af7d1e2dc4..5e06d3308a1 100644 --- a/Makefile +++ b/Makefile @@ -538,3 +538,12 @@ GOFAIL_VERSION = $(shell cd tools/mod && go list -m -f {{.Version}} go.etcd.io/g .PHONY: install-gofail install-gofail: go install go.etcd.io/gofail@${GOFAIL_VERSION} + + +.PHONY: gofail-enable +gofail-enable: install-gofail + PASSES="toggle_failpoints" FAILPOINTS=true ./test + +.PHONY: gofail-disable +gofail-disable: install-gofail + PASSES="toggle_failpoints" ./test diff --git a/test b/test index 6a916687c63..4cb508696c7 100755 --- a/test +++ b/test @@ -690,6 +690,10 @@ function build_cov_pass { go test -tags cov -c -covermode=set -coverpkg="$PKGS_COMMA" -o "${out}/etcdctl_test" "${REPO_PATH}/etcdctl" } +function toggle_failpoints_pass { + toggle_failpoints_default +} + # fail fast on static tests function build_pass { echo "Checking build..."