From: Ian Lance Taylor Date: Fri, 27 Dec 2013 21:42:26 +0000 (+0000) Subject: re PR go/59506 (net FAILs (timeout) on alpha) X-Git-Tag: releases/gcc-4.9.0~1907 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=afc8adc88f9cae98c5207cbad20c32c28e74bf3c;p=thirdparty%2Fgcc.git re PR go/59506 (net FAILs (timeout) on alpha) PR go/59506 net: use DialTimeout in TestSelfConnect Backported from master repository. This avoids problems with systems that take a long time to find out nothing is listening, while still testing for the self-connect misfeature since a self-connect should be fast. With this we may be able to remove the test for non-Linux systems. Tested (on GNU/Linux) by editing selfConnect in tcpsock_posix.go to always return false and verifying that TestSelfConnect then fails with and without this change. Idea from Uros Bizjak. From-SVN: r206224 --- diff --git a/libgo/go/net/dial_test.go b/libgo/go/net/dial_test.go index c7ffdd3d9c8f..973e69dea5d5 100644 --- a/libgo/go/net/dial_test.go +++ b/libgo/go/net/dial_test.go @@ -147,7 +147,7 @@ func TestSelfConnect(t *testing.T) { 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)