Commit 81957dd5 authored by Brad Fitzpatrick's avatar Brad Fitzpatrick

net: don't block forever in splice test cleanup on failure

The ppc64x builders are failing on the new splice test from CL 113997
but the actual failure is being obscured by a test deadlock.

Change-Id: I7747f88bcdba9776a3c0d2f5066cfec572706108
Reviewed-on: https://go-review.googlesource.com/133417
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: default avatarTobias Klauser <tobias.klauser@gmail.com>
parent 5789f838
......@@ -15,6 +15,7 @@ import (
"strconv"
"sync"
"testing"
"time"
)
func TestSplice(t *testing.T) {
......@@ -332,7 +333,19 @@ func startSpliceClient(conn Conn, op string, chunkSize, totalSize int) (func(),
close(donec)
}()
return func() { <-donec }, nil
return func() {
select {
case <-donec:
case <-time.After(5 * time.Second):
log.Printf("killing splice client after 5 second shutdown timeout")
cmd.Process.Kill()
select {
case <-donec:
case <-time.After(5 * time.Second):
log.Printf("splice client didn't die after 10 seconds")
}
}
}, nil
}
func init() {
......
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