Document why we have a loop retrying

This commit is contained in:
Jose Garcia 2022-03-21 12:11:00 -04:00
parent cd6176d911
commit b5a7a36ece

View file

@ -82,6 +82,8 @@ func TestPortForwarderStart(t *testing.T) {
go func() {
var conn net.Conn
// We retry DialTimeout in a loop to deal with a race in PortForwarder startup.
for tries := 0; conn == nil && tries < 2; tries++ {
conn, err = net.DialTimeout("tcp", ":8000", 2*time.Second)
if conn == nil {