Commit 0420eb3b authored by Alex Brainman's avatar Alex Brainman

net: report Accept error during TestVariousDeadlines1Proc test

R=golang-dev
CC=golang-dev
https://golang.org/cl/6868057
parent dfe29798
...@@ -410,16 +410,7 @@ func testVariousDeadlines(t *testing.T, maxProcs int) { ...@@ -410,16 +410,7 @@ func testVariousDeadlines(t *testing.T, maxProcs int) {
defer runtime.GOMAXPROCS(runtime.GOMAXPROCS(maxProcs)) defer runtime.GOMAXPROCS(runtime.GOMAXPROCS(maxProcs))
ln := newLocalListener(t) ln := newLocalListener(t)
defer ln.Close() defer ln.Close()
donec := make(chan struct{}) acceptc := make(chan error, 1)
defer close(donec)
testsDone := func() bool {
select {
case <-donec:
return true
}
return false
}
// The server, with no timeouts of its own, sending bytes to clients // The server, with no timeouts of its own, sending bytes to clients
// as fast as it can. // as fast as it can.
...@@ -428,9 +419,7 @@ func testVariousDeadlines(t *testing.T, maxProcs int) { ...@@ -428,9 +419,7 @@ func testVariousDeadlines(t *testing.T, maxProcs int) {
for { for {
c, err := ln.Accept() c, err := ln.Accept()
if err != nil { if err != nil {
if !testsDone() { acceptc <- err
t.Fatalf("Accept: %v", err)
}
return return
} }
go func() { go func() {
...@@ -504,6 +493,8 @@ func testVariousDeadlines(t *testing.T, maxProcs int) { ...@@ -504,6 +493,8 @@ func testVariousDeadlines(t *testing.T, maxProcs int) {
select { select {
case res := <-servec: case res := <-servec:
t.Logf("for %v: server in %v wrote %d, %v", name, res.d, res.n, res.err) t.Logf("for %v: server in %v wrote %d, %v", name, res.d, res.n, res.err)
case err := <-acceptc:
t.Fatalf("for %v: server Accept = %v", name, err)
case <-time.After(tooLong): case <-time.After(tooLong):
t.Fatalf("for %v, timeout waiting for server to finish writing", name) t.Fatalf("for %v, timeout waiting for server to finish writing", name)
} }
......
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