Skip to content

Commit

Permalink
fix(testutil): fix FreeTCPAddr localhost usage (backport #18996) (#18999
Browse files Browse the repository at this point in the history
)

Co-authored-by: gluax <16431709+gluax@users.noreply.github.com>
  • Loading branch information
mergify[bot] and gluax committed Jan 10, 2024
1 parent 7f1a2b3 commit fe4b58b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion testutil/network/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down

0 comments on commit fe4b58b

Please sign in to comment.