From fe4b58b2bddd85eb8032fa6dd94b18d1a4ff81ca Mon Sep 17 00:00:00 2001 From: "mergify[bot]" <37929162+mergify[bot]@users.noreply.github.com> Date: Wed, 10 Jan 2024 09:08:21 +0000 Subject: [PATCH] fix(testutil): fix FreeTCPAddr localhost usage (backport #18996) (#18999) Co-authored-by: gluax <16431709+gluax@users.noreply.github.com> --- testutil/network/util.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testutil/network/util.go b/testutil/network/util.go index c940e9225d8b..072184cea25d 100644 --- a/testutil/network/util.go +++ b/testutil/network/util.go @@ -220,7 +220,7 @@ func writeFile(name, dir string, contents []byte) error { // Get a free address for a test CometBFT server // protocol is either tcp, http, etc func FreeTCPAddr() (addr, port string, closeFn func() error, err error) { - l, err := net.Listen("tcp", "localhost:0") + l, err := net.Listen("tcp", "127.0.0.1:0") if err != nil { return "", "", nil, err }