File tree Expand file tree Collapse file tree 3 files changed +21
-0
lines changed
Expand file tree Collapse file tree 3 files changed +21
-0
lines changed Original file line number Diff line number Diff line change @@ -32,4 +32,7 @@ go_test(
3232 size = "small" ,
3333 srcs = ["gomaxprocs_test.go" ],
3434 library = ":gomaxprocs" ,
35+ deps = [
36+ "//pkg/sync" ,
37+ ],
3538)
Original file line number Diff line number Diff line change @@ -29,6 +29,7 @@ import (
2929 "runtime"
3030
3131 "gvisor.dev/gvisor/pkg/log"
32+ "gvisor.dev/gvisor/pkg/sync"
3233)
3334
3435var (
@@ -56,6 +57,11 @@ func SetBase(n int) {
5657// with negative n to remove temporary GOMAXPROCS when they are no longer
5758// needed.
5859func Add (n int ) {
60+ if sync .RaceEnabled {
61+ // FIXME: b/465516110
62+ log .Infof ("Race detection enabled: skipping temporary GOMAXPROCS adjustment" )
63+ return
64+ }
5965 mu .Lock ()
6066 defer mu .Unlock ()
6167 t := temp + n
Original file line number Diff line number Diff line change @@ -17,6 +17,8 @@ package gomaxprocs
1717import (
1818 "runtime"
1919 "testing"
20+
21+ "gvisor.dev/gvisor/pkg/sync"
2022)
2123
2224// reset cancels the effect of all previous calls to SetBase and Add and sets
@@ -30,6 +32,11 @@ func reset(n int) {
3032}
3133
3234func TestBasic (t * testing.T ) {
35+ if sync .RaceEnabled {
36+ // FIXME: b/465516110
37+ t .Skipf ("Race detection enabled: skipping test" )
38+ }
39+
3340 init := runtime .GOMAXPROCS (0 )
3441 defer reset (init )
3542
@@ -61,6 +68,11 @@ func TestBasic(t *testing.T) {
6168}
6269
6370func TestAddIgnoredUntilSetBase (t * testing.T ) {
71+ if sync .RaceEnabled {
72+ // FIXME: b/465516110
73+ t .Skipf ("Race detection enabled: skipping test" )
74+ }
75+
6476 init := runtime .GOMAXPROCS (0 )
6577 defer reset (init )
6678
You can’t perform that action at this time.
0 commit comments