From 798bf058389f1deae4e888c9c25c9fb0c39455c0 Mon Sep 17 00:00:00 2001 From: Andras Banki-Horvath Date: Mon, 19 Jul 2021 18:11:21 +0200 Subject: [PATCH 1/2] build: add itest-race build target to catch data races with itests This commit adds itest-race build target that can be used with individual itests to detect and catch uncovered data races. --- Makefile | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/Makefile b/Makefile index b9d6ee12..911bd276 100644 --- a/Makefile +++ b/Makefile @@ -143,6 +143,14 @@ build-itest: @$(call print, "Building itest binary for ${backend} backend.") CGO_ENABLED=0 $(GOTEST) -v ./lntest/itest -tags="$(DEV_TAGS) $(RPC_TAGS) rpctest $(backend)" -c -o lntest/itest/itest.test$(EXEC_SUFFIX) +build-itest-race: + @$(call print, "Building itest btcd and lnd with race detector.") + CGO_ENABLED=0 $(GOBUILD) -tags="rpctest" -o lntest/itest/btcd-itest$(EXEC_SUFFIX) $(ITEST_LDFLAGS) $(BTCD_PKG) + CGO_ENABLED=1 $(GOBUILD) -race -tags="$(ITEST_TAGS)" -o lntest/itest/lnd-itest$(EXEC_SUFFIX) $(ITEST_LDFLAGS) $(PKG)/cmd/lnd + + @$(call print, "Building itest binary for ${backend} backend.") + CGO_ENABLED=0 $(GOTEST) -v ./lntest/itest -tags="$(DEV_TAGS) $(RPC_TAGS) rpctest $(backend)" -c -o lntest/itest/itest.test$(EXEC_SUFFIX) + install: @$(call print, "Installing lnd and lncli.") $(GOINSTALL) -tags="${tags}" $(LDFLAGS) $(PKG)/cmd/lnd @@ -187,6 +195,8 @@ itest-only: itest: build-itest itest-only +itest-race: build-itest-race itest-only + itest-parallel: build-itest @$(call print, "Running tests") rm -rf lntest/itest/*.log lntest/itest/.logs-*; date From bc3886c85b4069251b420ea4a0cefba2ce8aabe7 Mon Sep 17 00:00:00 2001 From: Andras Banki-Horvath Date: Mon, 19 Jul 2021 18:15:47 +0200 Subject: [PATCH 2/2] docs: update release notes --- docs/release-notes/release-notes-0.14.0.md | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/docs/release-notes/release-notes-0.14.0.md b/docs/release-notes/release-notes-0.14.0.md index e2b80b92..175c5798 100644 --- a/docs/release-notes/release-notes-0.14.0.md +++ b/docs/release-notes/release-notes-0.14.0.md @@ -2,11 +2,14 @@ # Build System -[A new pre-submit check has been -added](https://github.com/lightningnetwork/lnd/pull/5520) to ensure that all -PRs ([aside from merge -commits](https://github.com/lightningnetwork/lnd/pull/5543)) add an entry in -the release notes folder that at leasts links to PR being added. +* [A new pre-submit check has been + added](https://github.com/lightningnetwork/lnd/pull/5520) to ensure that all + PRs ([aside from merge + commits](https://github.com/lightningnetwork/lnd/pull/5543)) add an entry in + the release notes folder that at leasts links to PR being added. + +* [A new build target itest-race](https://github.com/lightningnetwork/lnd/pull/5542) + to help uncover undetected data races with our itests. # Code Health