1
0
mirror of https://github.com/golang/go synced 2024-11-17 13:14:56 -07:00
go/src/testing
Bryan C. Mills 26b1694d9a testing: add regression tests for reentrant calls to T.Run
These tests represent two patterns of usage, found in Google-internal
tests, that deadlocked after CL 506755.

TestConcurrentRun is a minor variation on TestParallelSub, with the
additional expectation that the concurrent calls to Run (without
explicit calls to Parallel) proceed without blocking. It replaces
TestParallelSub.

TestParentRun is similar, but instead of calling Run concurrently it
calls Run from within the subtest body. It almost certainly represents
an accidental misuse of T.Run, but since that pattern used to run to
completion we don't want to break it accidentally. (Perhaps it should
be diagnosed with a vet check instead?)

While we are testing concurrency, this also cleans up
TestConcurrentCleanup to use a clearer synchronization pattern.

Fixes #64402.

Change-Id: I14fc7e7085a994c284509eac28190c3a8feb04cd
Reviewed-on: https://go-review.googlesource.com/c/go/+/546019
Auto-Submit: Bryan Mills <bcmills@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Alan Donovan <adonovan@google.com>
2023-12-01 21:27:08 +00:00
..
fstest
internal/testdeps
iotest
quick
slogtest
allocs_test.go
allocs.go
benchmark_test.go
benchmark.go Revert "testing: simplify concurrency and cleanup logic" 2023-11-27 16:49:24 +00:00
cover.go
example.go
export_test.go
flag_test.go
fuzz.go Revert "testing: simplify concurrency and cleanup logic" 2023-11-27 16:49:24 +00:00
helper_test.go testing: use subprocesses in TestTBHelper and TestTBHelperParallel 2023-11-21 17:24:47 +00:00
helperfuncs_test.go testing: use subprocesses in TestTBHelper and TestTBHelperParallel 2023-11-21 17:24:47 +00:00
match_test.go
match.go
newcover.go
panic_test.go Revert "testing: simplify concurrency and cleanup logic" 2023-11-27 16:49:24 +00:00
run_example_wasm.go
run_example.go
sub_test.go testing: add regression tests for reentrant calls to T.Run 2023-12-01 21:27:08 +00:00
testing_other.go
testing_test.go testing: add regression tests for reentrant calls to T.Run 2023-12-01 21:27:08 +00:00
testing_windows.go
testing.go testing: remove tests from the running log while they are waiting on parallel subtests 2023-11-30 16:41:22 +00:00