Skip to content

Commit 192c59c

Browse files
author
Sergey Fedorov
committed
Add fix for tests on MacOS 12 with -race flag
1 parent 8bd1445 commit 192c59c

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# [Unreleased]
22

33
* Verify git tag on release (#347, @miry)
4+
* Fix MacOS 12 tests for go17 with -race flag (#351 @strech)
45

56
# [2.3.0] - 2021-12-23
67

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)