summaryrefslogtreecommitdiffhomepage
path: root/test/iptables/iptables_util.go
diff options
context:
space:
mode:
authorKevin Krakauer <krakauer@google.com>2020-03-18 14:44:56 -0700
committerKevin Krakauer <krakauer@google.com>2020-03-18 18:16:33 -0700
commita8f9cc87989979b6d8bc3759e64bdd1b76329b64 (patch)
tree505a8e3d42bb550f930eea610daf99f044229e6b /test/iptables/iptables_util.go
parentfc16e64396cf534bc4336e6bc0396a2f0f621e70 (diff)
iptables: deflake DropTCP*Port tests
These tests could timeout because net.DialTCP didn't respect the timeout.
Diffstat (limited to 'test/iptables/iptables_util.go')
-rw-r--r--test/iptables/iptables_util.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/test/iptables/iptables_util.go b/test/iptables/iptables_util.go
index e8ae65c5a..134391e8d 100644
--- a/test/iptables/iptables_util.go
+++ b/test/iptables/iptables_util.go
@@ -144,7 +144,7 @@ func connectTCP(ip net.IP, port int, timeout time.Duration) error {
// The container may not be listening when we first connect, so retry
// upon error.
callback := func() error {
- conn, err := net.DialTCP("tcp4", nil, &contAddr)
+ conn, err := net.DialTimeout("tcp", contAddr.String(), timeout)
if conn != nil {
conn.Close()
}