Skip to content

Commit

Permalink
misc/cgo/test: make TestSetgidStress cheaper
Browse files Browse the repository at this point in the history
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 <[email protected]>
TryBot-Result: Gopher Robot <[email protected]>
Run-TryBot: Cherry Mui <[email protected]>
  • Loading branch information
cherrymui committed Jul 6, 2022
1 parent 2007599 commit 4484c30
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion misc/cgo/test/setgid2_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down

0 comments on commit 4484c30

Please sign in to comment.