]> Cypherpunks repositories - gostls13.git/commit
testing: fix panicking tests hang if Cleanup calls FailNow
authorChangkun Ou <hi@changkun.us>
Mon, 14 Sep 2020 08:24:59 +0000 (10:24 +0200)
committerIan Lance Taylor <iant@golang.org>
Mon, 14 Sep 2020 20:27:49 +0000 (20:27 +0000)
commita408139bb0166f6e0a5d9fd17fc934da960c354e
treef5cade5946cab5b71a931a344a4a56143695b57d
parent57646534297a9bd193e6aaa4239c98984f371b97
testing: fix panicking tests hang if Cleanup calls FailNow

Previously, it was impossible to call FailNow in a Cleanup.
Because it can terminate a panicking goroutine and cause its
parent hangs on t.signal channel. This CL sends the signal
in a deferred call to prevent the hang.

Fixes #41355

Change-Id: I4552d3a7ea763ef86817bf9b50c0e37fb34bf20f
Reviewed-on: https://go-review.googlesource.com/c/go/+/254637
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Emmanuel Odeke <emm.odeke@gmail.com>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Trust: Emmanuel Odeke <emm.odeke@gmail.com>
src/cmd/go/testdata/script/test_cleanup_failnow.txt [new file with mode: 0644]
src/testing/testing.go