diff --git a/Makefile b/Makefile index bab5ce8919403..91fbfb8728a25 100644 --- a/Makefile +++ b/Makefile @@ -6,6 +6,7 @@ TESTFLAGS=-race -p 4 BASE_DIR=$(CURDIR) BENCHTIME ?= 1x BENCHTIMEOUT ?= 20m +BENCHCOUNT ?= 1 ifeq (,$(findstring podman,$(shell docker --version 2>/dev/null))) # Podman DTRT by running processes unprivileged in containers, @@ -512,7 +513,7 @@ go-postgres-unit-tests: build-prep test-prep go-postgres-bench-tests: build-prep test-prep @# The -p 1 passed to go test is required to ensure that tests of different packages are not run in parallel, so as to avoid conflicts when interacting with the DB. set -o pipefail ; \ - CGO_ENABLED=1 GODEBUG=cgocheck=2 MUTEX_WATCHDOG_TIMEOUT_SECS=30 ROX_POSTGRES_DATASTORE=true GOTAGS=$(GOTAGS),test,sql_integration scripts/go-test.sh -p 1 -run=nonthing -bench=. -benchtime=$(BENCHTIME) -benchmem -timeout $(BENCHTIMEOUT) -v \ + CGO_ENABLED=1 GODEBUG=cgocheck=2 MUTEX_WATCHDOG_TIMEOUT_SECS=30 ROX_POSTGRES_DATASTORE=true GOTAGS=$(GOTAGS),test,sql_integration scripts/go-test.sh -p 1 -run=nonthing -bench=. -benchtime=$(BENCHTIME) -benchmem -timeout $(BENCHTIMEOUT) -count $(BENCHCOUNT) -v \ $(shell git grep -rl "testing.B" central pkg migrator tools | sed -e 's@^@./@g' | xargs -n 1 dirname | sort | uniq | xargs go list -tags sql_integration | grep -v '^github.com/stackrox/rox/tests$$' | grep -Ev $(UNIT_TEST_IGNORE)) \ | tee $(GO_TEST_OUTPUT_PATH)