From: Brad Fitzpatrick Date: Wed, 5 Sep 2018 13:34:25 +0000 (+0000) Subject: net: don't block forever in splice test cleanup on failure X-Git-Tag: go1.12beta1~1157 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=81957dd58ee3a4c31f949e49e03d8ff9151ccef5;p=gostls13.git 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 TryBot-Result: Gobot Gobot Reviewed-by: Tobias Klauser --- diff --git a/src/net/splice_test.go b/src/net/splice_test.go index 656c194094..93e8b1f8cc 100644 --- a/src/net/splice_test.go +++ b/src/net/splice_test.go @@ -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() {