Skip to content

Commit f0aaf17

Browse files
authored
Merge pull request #1044 from lightninglabs/flake-unit-race-pkg
Pass 'pkg' argument to `flake-unit-race` Makefile target
2 parents 0dfdb12 + b3a0095 commit f0aaf17

File tree

2 files changed

+5
-8
lines changed

2 files changed

+5
-8
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ flake-unit-trace:
226226

227227
flake-unit-race:
228228
@$(call print, "Flake hunting races in unit tests.")
229-
while [ $$? -eq 0 ]; do env CGO_ENABLED=1 GORACE="history_size=7 halt_on_errors=1" $(GOLIST) | $(XARGS) env $(GOTEST) -race -test.timeout=20m -count=1; done
229+
while [ $$? -eq 0 ]; do $(GOLIST) | $(XARGS) env CGO_ENABLED=1 GORACE="history_size=7 halt_on_errors=1" $(GOTEST) -race -test.timeout=20m -count=1; done
230230

231231
# =============
232232
# FUZZING

make/testing_flags.mk

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,12 @@ RPC_TAGS = autopilotrpc chainrpc invoicesrpc peersrpc routerrpc signrpc verrpc w
44
LOG_TAGS =
55
TEST_FLAGS =
66
ITEST_FLAGS = -logoutput
7-
COVER_PKG = $$(go list -deps -tags="$(DEV_TAGS)" ./... | grep '$(PKG)' | grep -v lnrpc)
8-
RACE_PKG = go list -deps -tags="$(DEV_TAGS)" ./... | grep '$(PKG)'
97
COVER_HTML = go tool cover -html=coverage.txt -o coverage.html
108
POSTGRES_START_DELAY = 5
119

10+
GOLIST := go list -tags="$(DEV_TAGS)" -deps $(PKG)/... | grep '$(PKG)'| grep -v '/vendor/'
11+
GOLISTCOVER := $(shell go list -tags="$(DEV_TAGS)" -deps -f '{{.ImportPath}}' ./... | grep '$(PKG)' | sed -e 's/^$(ESCPKG)/./')
12+
1213
# If rpc option is set also add all extra RPC tags to DEV_TAGS
1314
ifneq ($(with-rpc),)
1415
DEV_TAGS += $(RPC_TAGS)
@@ -19,8 +20,7 @@ endif
1920
ifneq ($(pkg),)
2021
UNITPKG := $(PKG)/$(pkg)
2122
UNIT_TARGETED = yes
22-
COVER_PKG = $(PKG)/$(pkg)
23-
RACE_PKG = $(PKG)/$(pkg)
23+
GOLIST = echo '$(PKG)/$(pkg)'
2424
endif
2525

2626
# If a specific unit test case is being target, construct test.run filter.
@@ -83,9 +83,6 @@ else
8383
TEST_FLAGS += -test.timeout=20m
8484
endif
8585

86-
GOLIST := go list -tags="$(DEV_TAGS)" -deps $(PKG)/... | grep '$(PKG)'| grep -v '/vendor/'
87-
GOLISTCOVER := $(shell go list -tags="$(DEV_TAGS)" -deps -f '{{.ImportPath}}' ./... | grep '$(PKG)' | sed -e 's/^$(ESCPKG)/./')
88-
8986
# UNIT_TARGTED is undefined iff a specific package and/or unit test case is
9087
# not being targeted.
9188
UNIT_TARGETED ?= no

0 commit comments

Comments
 (0)