Skip to content

Commit

Permalink
Fix panic in wait host port
Browse files Browse the repository at this point in the history
When DialWithContext fails we were not checking for error.

Fixed #139

Signed-off-by: Gianluca Arbezzano <gianarb92@gmail.com>
  • Loading branch information
Gianluca Arbezzano committed Feb 5, 2020
1 parent c0c9a5c commit bb1c462
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion wait/host_port.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,14 @@ package wait
import (
"context"
"fmt"
"github.com/pkg/errors"
"net"
"os"
"strconv"
"syscall"
"time"

"github.com/pkg/errors"

"github.com/docker/go-connections/nat"
)

Expand Down Expand Up @@ -70,6 +71,9 @@ func (hp *HostPortStrategy) WaitUntilReady(ctx context.Context, target StrategyT
address := net.JoinHostPort(ipAddress, portString)
for {
conn, err := dialer.DialContext(ctx, proto, address)
if err != nil {
return err
}
defer conn.Close()
if err != nil {
if v, ok := err.(*net.OpError); ok {
Expand Down

0 comments on commit bb1c462

Please sign in to comment.