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() {