add a timeout trying to open a random port
This commit is contained in:
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…
Reference in New Issue