From b2ab5e8af140fb72f9a3979eb6d1d37e52faa014 Mon Sep 17 00:00:00 2001 From: Andras Banki-Horvath Date: Wed, 6 Jan 2021 19:42:08 +0100 Subject: [PATCH] itests: run etcd itests with generated ports --- Makefile | 2 +- lntest/node.go | 13 +++++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 4b10a2ff..b5f55e29 100644 --- a/Makefile +++ b/Makefile @@ -176,7 +176,7 @@ itest: build-itest itest-only itest-parallel: build-itest @$(call print, "Running tests") rm -rf lntest/itest/*.log lntest/itest/.logs-*; date - EXEC_SUFFIX=$(EXEC_SUFFIX) echo "$$(seq 0 $$(expr $(ITEST_PARALLELISM) - 1))" | xargs -P $(ITEST_PARALLELISM) -n 1 -I {} scripts/itest_part.sh {} $(NUM_ITEST_TRANCHES) $(TEST_FLAGS) + EXEC_SUFFIX=$(EXEC_SUFFIX) echo "$$(seq 0 $$(expr $(ITEST_PARALLELISM) - 1))" | xargs -P $(ITEST_PARALLELISM) -n 1 -I {} scripts/itest_part.sh {} $(NUM_ITEST_TRANCHES) $(TEST_FLAGS) $(ITEST_FLAGS) lntest/itest/log_check_errors.sh unit: btcd diff --git a/lntest/node.go b/lntest/node.go index 73b44acd..1bf009db 100644 --- a/lntest/node.go +++ b/lntest/node.go @@ -298,6 +298,19 @@ func (cfg NodeConfig) genArgs() []string { if cfg.Etcd { args = append(args, "--db.backend=etcd") args = append(args, "--db.etcd.embedded") + args = append( + args, fmt.Sprintf( + "--db.etcd.embedded_client_port=%v", + nextAvailablePort(), + ), + ) + args = append( + args, fmt.Sprintf( + "--db.etcd.embedded_peer_port=%v", + nextAvailablePort(), + ), + ) + args = append(args, "--db.etcd.embedded") } if cfg.FeeURL != "" {