add a timeout trying to open a random port

pull/7589/head
Adrien Delorme 7 years ago
parent 2fd7adffc4
commit e14d1b8b0b

@ -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)
}
}

Loading…
Cancel
Save