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 testing: add available godoc link 2023-11-08 17:55:47 +00:00
internal/testdeps testing: add available godoc link 2023-11-08 17:55:47 +00:00
iotest testing: add available godoc link 2023-11-08 17:55:47 +00:00
quick testing: add available godoc link 2023-11-08 17:55:47 +00:00
slogtest testing: add available godoc link 2023-11-08 17:55:47 +00:00
allocs.go
allocs_test.go
benchmark.go Revert "testing: simplify concurrency and cleanup logic" 2023-11-27 16:49:24 +00:00
benchmark_test.go testing: add an example showcasing B.RunParallel with B.ReportMetric 2022-10-07 17:49:17 +00:00
cover.go cmd/go,testing: re-implement testing.Coverage 2023-05-23 11:37:31 +00:00
example.go testing: enforce -skip in example tests 2023-07-21 21:37:46 +00:00
export_test.go
flag_test.go all: use ^TestName$ regular pattern for invoking a single test 2023-09-05 23:35:29 +00:00
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.go all: use built-in clear to clear maps 2023-07-27 22:07:13 +00:00
match_test.go cmd/go, testing: add go test -skip flag 2022-09-16 14:48:54 +00:00
newcover.go cmd/go,testing: re-implement testing.Coverage 2023-05-23 11:37:31 +00:00
panic_test.go Revert "testing: simplify concurrency and cleanup logic" 2023-11-27 16:49:24 +00:00
run_example.go all: add wasip1 support 2023-04-11 20:56:32 +00:00
run_example_wasm.go all: add wasip1 support 2023-04-11 20:56:32 +00:00
sub_test.go testing: add regression tests for reentrant calls to T.Run 2023-12-01 21:27:08 +00:00
testing.go testing: remove tests from the running log while they are waiting on parallel subtests 2023-11-30 16:41:22 +00:00
testing_other.go testing: include ERROR_SHARING_VIOLATION in Windows cleanup retries 2022-03-03 02:39:01 +00:00
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: include ERROR_SHARING_VIOLATION in Windows cleanup retries 2022-03-03 02:39:01 +00:00