Skip to content

Commit f03df8f

Browse files
author
Sergey Fedorov
committed
Add fix for tests on MacOS 12 with -race flag
1 parent 1cc0681 commit f03df8f

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

Makefile

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,16 @@
1+
OS := $(shell uname -s)
2+
GO_VERSION := $(shell go version | cut -f3 -d" ")
3+
GO_MINOR_VERSION := $(shell echo $(GO_VERSION) | cut -f2 -d.)
4+
GO_PATCH_VERSION := $(shell echo $(GO_VERSION) | cut -f3 -d. | sed "s/^\s*$$/0/")
5+
MALLOC_ENV := $(shell [ $(OS) = Darwin -a $(GO_MINOR_VERSION) -eq 17 -a $(GO_PATCH_VERSION) -lt 6 ] && echo "MallocNanoZone=0")
6+
17
.PHONY: all
28
all: setup build test bench fmt lint
39

410
.PHONY: test
511
test:
6-
go test -v -race -timeout 1m ./...
12+
# NOTE: https://github.com/golang/go/issues/49138
13+
$(MALLOC_ENV) go test -v -race -timeout 1m ./...
714

815
.PHONY: bench
916
bench:

0 commit comments

Comments
 (0)