]> Cypherpunks repositories - gostls13.git/commit
testing: fail if T.Setenv is called via T.Run in a parallel test
authorNobuki Fujii <scofni@gmail.com>
Sun, 18 Sep 2022 02:52:07 +0000 (11:52 +0900)
committerGopher Robot <gobot@golang.org>
Wed, 28 Sep 2022 17:18:17 +0000 (17:18 +0000)
commitd6ca24477afa85a3ab559935faa4fed917911e4f
tree0e988ed0c2132fcb1fb47fed3150863090c08996
parent7f7f27f992850a06551c2798a3b874f5d5356ae9
testing: fail if T.Setenv is called via T.Run in a parallel test

The existing implementation can call to T.Setenv in T.Run even after
calling to T.Parallel, so I changed it to cause a panic in that case.

Fixes #55128

Change-Id: Ib89d998ff56f00f96a5ca218af071bd35fdae53a
Reviewed-on: https://go-review.googlesource.com/c/go/+/431101
Run-TryBot: Bryan Mills <bcmills@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Reviewed-by: Bryan Mills <bcmills@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Auto-Submit: Bryan Mills <bcmills@google.com>
src/testing/testing.go
src/testing/testing_test.go