Commit 8c30b3f0 authored by Dave Cheney's avatar Dave Cheney

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
parent ee9d148c
......@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment