go/src/testing
Changkun Ou 4cba6c703f 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>
2020-09-24 19:32:05 +00:00
..
internal/testdeps cmd/go, testing, os: fail test that calls os.Exit(0) 2020-08-27 23:19:15 +00:00
iotest testing/iotest: correct ErrReader signature and remove exported error 2020-08-18 00:08:36 +00:00
quick all: shorten some tests 2019-05-22 12:54:00 +00:00
allocs.go
allocs_test.go
benchmark.go testing: flush test summaries to stdout atomically when streaming output 2020-09-02 14:22:42 +00:00
benchmark_test.go testing: shorten go test -short testing 2019-05-16 03:25:08 +00:00
cover.go testing/cover: improve message when a package has no statements 2019-03-13 04:11:58 +00:00
example.go testing: fail Example tests that invoke runtime.Goexit 2020-09-01 20:13:34 +00:00
export_test.go testing: stop rounding b.N 2019-03-20 21:19:16 +00:00
helper_test.go testing: fix reported caller name for funcs passed to Cleanup 2020-05-05 22:44:36 +00:00
helperfuncs_test.go testing: fix reported caller name for funcs passed to Cleanup 2020-05-05 22:44:36 +00:00
match.go testing: fix typo mistake 2018-04-27 13:29:12 +00:00
match_test.go
panic_test.go testing: don't run Cleanup functions until parallel subtests complete 2020-01-16 21:32:12 +00:00
run_example.go testing: fail Example tests that invoke runtime.Goexit 2020-09-01 20:13:34 +00:00
run_example_js.go testing: fail Example tests that invoke runtime.Goexit 2020-09-01 20:13:34 +00:00
sub_test.go testing: flush test summaries to stdout atomically when streaming output 2020-09-02 14:22:42 +00:00
testing.go testing: send t.signal only if there is no panic 2020-09-24 19:32:05 +00:00
testing_test.go testing: make TempDir idempotent for both Cleanup and Benchmark 2020-09-05 04:21:49 +00:00