1
0
mirror of https://github.com/golang/go synced 2024-11-26 08:17:59 -07:00

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
This commit is contained in:
Dave Cheney 2013-02-14 10:11:16 +11:00
parent ee9d148ce1
commit 8c30b3f038

View 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