Skip to content

Commit

Permalink
Merge pull request #144 from testcontainers/fix/panic-hostport
Browse files Browse the repository at this point in the history
Fix panic in wait host port
  • Loading branch information
gianarb authored Feb 5, 2020
2 parents c0c9a5c + bb1c462 commit fc5599f
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 fc5599f

Please sign in to comment.