From e14d1b8b0bdf2da2e40e46175249d260c36cec1d Mon Sep 17 00:00:00 2001 From: Adrien Delorme Date: Wed, 1 May 2019 12:01:34 +0200 Subject: [PATCH] add a timeout trying to open a random port --- common/net/configure_port.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/common/net/configure_port.go b/common/net/configure_port.go index cdc0a9168..fddd4b5d6 100644 --- a/common/net/configure_port.go +++ b/common/net/configure_port.go @@ -7,6 +7,7 @@ import ( "math/rand" "net" "strconv" + "time" "github.com/hashicorp/packer/common/filelock" "github.com/hashicorp/packer/packer" @@ -97,5 +98,6 @@ func (lc ListenRangeConfig) Listen(ctx context.Context) (*Listener, error) { lock: lock, }, err + time.Sleep(20 * time.Millisecond) } }