Commit d6fd52c0 authored by Dmitriy Vyukov's avatar Dmitriy Vyukov

net: fix flaky test

The test failed on one of the builders with:
timeout_test.go:594: 	ln.Accept: accept tcp 127.0.0.1:19373: use of closed network connection
http://build.golang.org/log/e83f4a152b37071b9d079096e15913811ad296b5

R=golang-dev, bradfitz, dave, mikioh.mikioh, remyoudompheng, rsc
CC=golang-dev
https://golang.org/cl/6859043
parent 478aff3d
...@@ -588,8 +588,10 @@ func TestProlongTimeout(t *testing.T) { ...@@ -588,8 +588,10 @@ func TestProlongTimeout(t *testing.T) {
ln := newLocalListener(t) ln := newLocalListener(t)
defer ln.Close() defer ln.Close()
connected := make(chan bool)
go func() { go func() {
s, err := ln.Accept() s, err := ln.Accept()
connected <- true
if err != nil { if err != nil {
t.Fatalf("ln.Accept: %v", err) t.Fatalf("ln.Accept: %v", err)
} }
...@@ -619,6 +621,7 @@ func TestProlongTimeout(t *testing.T) { ...@@ -619,6 +621,7 @@ func TestProlongTimeout(t *testing.T) {
t.Fatalf("DialTCP: %v", err) t.Fatalf("DialTCP: %v", err)
} }
defer c.Close() defer c.Close()
<-connected
for i := 0; i < 1024; i++ { for i := 0; i < 1024; i++ {
var buf [1]byte var buf [1]byte
c.Write(buf[:]) c.Write(buf[:])
......
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