]> Cypherpunks repositories - gostls13.git/commit
testing: send t.signal only if there is no panic
authorChangkun Ou <hi@changkun.us>
Sat, 19 Sep 2020 21:32:12 +0000 (23:32 +0200)
committerEmmanuel Odeke <emm.odeke@gmail.com>
Thu, 24 Sep 2020 19:32:05 +0000 (19:32 +0000)
commit4cba6c703f68a7c1718e589feaeb2530d7812fbf
treea79aa53e14c7050c9deb471a71a4f73e2a951c87
parent428509402b03c608e625a4844ab0cce75e4bead2
testing: send t.signal only if there is no panic

If a signal is sent to t.signal before the panic is triggered,
a panicking test may end up with "warning: no tests to run" because
the tRunner that invokes the test in t.Run calls runtime.Goexit on
panic, which causes the panicking test not be recorded in runTests.

Send the signal if and only if there is no panic.

Fixes #41479

Change-Id: I812f1303bfe02c443a1902732e68d21620d6672e
Reviewed-on: https://go-review.googlesource.com/c/go/+/256098
Run-TryBot: Emmanuel Odeke <emm.odeke@gmail.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Emmanuel Odeke <emm.odeke@gmail.com>
Trust: Emmanuel Odeke <emm.odeke@gmail.com>
Trust: Bryan C. Mills <bcmills@google.com>
src/cmd/go/testdata/script/test_cleanup_failnow.txt
src/testing/testing.go