]> Cypherpunks repositories - gostls13.git/commitdiff
net: remove noisy test for issue 3590
authorDave Cheney <dave@cheney.net>
Wed, 13 Feb 2013 23:11:16 +0000 (10:11 +1100)
committerDave Cheney <dave@cheney.net>
Wed, 13 Feb 2013 23:11:16 +0000 (10:11 +1100)
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

index fd1385ef9342d65e3bbb1a71f04b10614cb636f2..664ef1bf19d6348aec1badc99fb81fc7b6721d1e 100644 (file)
@@ -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