Only sleep if conn is nil

This commit is contained in:
Jose Garcia 2022-03-21 11:09:52 -04:00
parent b7bdb369f1
commit 107ea6c440

View file

@ -85,7 +85,9 @@ func TestPortForwarderStart(t *testing.T) {
retries := 0
for conn == nil && retries < 2 {
conn, err = net.DialTimeout("tcp", ":8000", 2*time.Second)
time.Sleep(1 * time.Second)
if conn == nil {
time.Sleep(1 * time.Second)
}
}
if conn == nil {
done <- errors.New("failed to connect to forwarded port")