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"
|
"math/rand"
|
||||||
"net"
|
"net"
|
||||||
"strconv"
|
"strconv"
|
||||||
|
"time"
|
||||||
|
|
||||||
"github.com/hashicorp/packer/common/filelock"
|
"github.com/hashicorp/packer/common/filelock"
|
||||||
"github.com/hashicorp/packer/packer"
|
"github.com/hashicorp/packer/packer"
|
||||||
|
@ -97,5 +98,6 @@ func (lc ListenRangeConfig) Listen(ctx context.Context) (*Listener, error) {
|
||||||
lock: lock,
|
lock: lock,
|
||||||
}, err
|
}, err
|
||||||
|
|
||||||
|
time.Sleep(20 * time.Millisecond)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue