From 8c30b3f038fe140d7f05ebe60d090e1d4a2eb3b5 Mon Sep 17 00:00:00 2001 From: Dave Cheney Date: Thu, 14 Feb 2013 10:11:16 +1100 Subject: [PATCH] net: remove noisy test for issue 3590 The test for issue 3590 causes an error to be printed to stderr when run (although the error is obscured during go test std). This is confusing for people who get breakage in the net package as the error is harmless and most likely unrelated to their build breakage. Given the way the test works, by reaching into the guts of the netFD, I can't see a way to silence the error without adding a bunch of code to support the test, therefore I am suggesting the test be removed before Go 1.1 ships. R=alex.brainman, mikioh.mikioh, rsc CC=golang-dev https://golang.org/cl/7307110 --- src/pkg/net/fd_unix_test.go | 48 ------------------------------------- 1 file changed, 48 deletions(-) diff --git a/src/pkg/net/fd_unix_test.go b/src/pkg/net/fd_unix_test.go index fd1385ef93..664ef1bf19 100644 --- a/src/pkg/net/fd_unix_test.go +++ b/src/pkg/net/fd_unix_test.go @@ -12,54 +12,6 @@ import ( "testing" ) -// Issue 3590. netFd.AddFD should return an error -// from the underlying pollster rather than panicing. -func TestAddFDReturnsError(t *testing.T) { - ln := newLocalListener(t).(*TCPListener) - defer ln.Close() - connected := make(chan bool) - go func() { - for { - c, err := ln.Accept() - if err != nil { - return - } - connected <- true - defer c.Close() - } - }() - - c, err := DialTCP("tcp", nil, ln.Addr().(*TCPAddr)) - if err != nil { - t.Fatal(err) - } - defer c.Close() - <-connected - - // replace c's pollServer with a closed version. - ps, err := newPollServer() - if err != nil { - t.Fatal(err) - } - ps.poll.Close() - c.conn.fd.pollServer = ps - - var b [1]byte - _, err = c.Read(b[:]) - if err, ok := err.(*OpError); ok { - if err.Op == "addfd" { - return - } - if err, ok := err.Err.(*OpError); ok { - // the err is sometimes wrapped by another OpError - if err.Op == "addfd" { - return - } - } - } - t.Error("unexpected error:", err) -} - var chkReadErrTests = []struct { n int err error -- 2.48.1