1
0
mirror of https://github.com/golang/go synced 2024-07-08 12:18:55 +00:00

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>
This commit is contained in:
Cherry Mui 2022-07-01 12:56:39 -04:00
parent 2007599dc8
commit 4484c30f78

View File

@ -20,7 +20,10 @@ import (
)
func testSetgidStress(t *testing.T) {
const N = 1000
var N = 1000
if testing.Short() {
N = 50
}
ch := make(chan int, N)
for i := 0; i < N; i++ {
go func() {