diff mbox

libgo patch committed: Use DialTimeout in self-connect test

Message ID mcra9fmq8al.fsf@iant-glaptop.roam.corp.google.com
State New
Headers show

Commit Message

Ian Lance Taylor Dec. 27, 2013, 9:43 p.m. UTC
This patch from Uros Bizjak changes TestSelfConnect to use DialTimeout,
to avoid a problem where some operating systems take a long time to fail
a connection to localhost.  This patch adds a timeout to make the
connection fail quickly.  This is PR 59506.  Ran Go testsuite on
x86_64-unknown-linux-gnu.  Committed to mainline.

Ian
diff mbox

Patch

diff -r 9f703c696641 libgo/go/net/dial_test.go
--- a/libgo/go/net/dial_test.go	Tue Dec 17 12:26:20 2013 -0800
+++ b/libgo/go/net/dial_test.go	Fri Dec 27 13:37:23 2013 -0800
@@ -147,7 +147,7 @@ 
 		n = 100
 	}
 	for i := 0; i < n; i++ {
-		c, err := Dial("tcp", addr)
+		c, err := DialTimeout("tcp", addr, time.Millisecond)
 		if err == nil {
 			c.Close()
 			t.Errorf("#%d: Dial %q succeeded", i, addr)