Skip to content

Commit 4484c30

Browse files
committed
misc/cgo/test: make TestSetgidStress cheaper
TestSetgidStress spawns 1000 threads, which can be expensive on some platforms or slow builders. Run with 50 threads in short mode instead. This makes the failure less reproducible even with buggy code. But one can manually stress test it (e.g. when a flaky failure appear on the builder). Fixes #53641. Change-Id: I33b5ea5ecaa8c7a56f59c16f9171657ee295db47 Reviewed-on: https://go-review.googlesource.com/c/go/+/415677 Reviewed-by: Austin Clements <austin@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Run-TryBot: Cherry Mui <cherryyz@google.com>
1 parent 2007599 commit 4484c30

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

misc/cgo/test/setgid2_linux.go

+4-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,10 @@ import (
2020
)
2121

2222
func testSetgidStress(t *testing.T) {
23-
const N = 1000
23+
var N = 1000
24+
if testing.Short() {
25+
N = 50
26+
}
2427
ch := make(chan int, N)
2528
for i := 0; i < N; i++ {
2629
go func() {

0 commit comments

Comments
 (0)