From bb60a76bad52a142516f19c4d80fee302b1773a2 Mon Sep 17 00:00:00 2001 From: kruskal <99559985+kruskall@users.noreply.github.com> Date: Sat, 3 Aug 2024 01:02:24 +0200 Subject: [PATCH] test: enable race detector Unfortunately we can only enable the race detector for ci and unit tests. system-tests are building the apm-server binary (CGO disabled by default) so we can't enable the race detector as it requires cgo. --- .github/workflows/ci.yml | 2 +- Makefile | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 24a8aaa61ce..a80b381c5c3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -53,7 +53,7 @@ jobs: cache: true - env: CGO_ENABLED: "0" - run: go test -v ./... + run: go test -v -race ./... system-test: runs-on: ubuntu-latest diff --git a/Makefile b/Makefile index 30e5d691ff4..5361e650966 100644 --- a/Makefile +++ b/Makefile @@ -78,11 +78,11 @@ apm-server-oss: .PHONY: test test: - @go test $(GOMODFLAG) $(GOTESTFLAGS) ./... + @go test $(GOMODFLAG) $(GOTESTFLAGS) -race ./... .PHONY: system-test system-test: - @(cd systemtest; go test $(GOMODFLAG) $(GOTESTFLAGS) -timeout=20m ./...) + @(cd systemtest; go test $(GOMODFLAG) $(GOTESTFLAGS) -race -timeout=20m ./...) .PHONY: clean: