From: Michael Pratt Date: Wed, 21 May 2025 18:49:40 +0000 (-0400) Subject: runtime: use DontUpdate testprog for DontUpdate test X-Git-Tag: go1.25rc1~119 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=d54703c94ae906a5e851ae95909b6eb2f0314e19;p=gostls13.git runtime: use DontUpdate testprog for DontUpdate test This is a typo in CL 670497. The test is using the wrong testprog function. The testprog also needs to assert that GOMAXPROCS doesn't change, not that it is equal to NumCPU, for the GOMAXPROCS=4 case. For #73193. Cq-Include-Trybots: luci.golang.try:gotip-windows-amd64-longtest Change-Id: I6a6a636cab6936aa8519e3553b70ab6641ca8010 Reviewed-on: https://go-review.googlesource.com/c/go/+/675097 Auto-Submit: Michael Pratt LUCI-TryBot-Result: Go LUCI Reviewed-by: Michael Knyszek --- diff --git a/src/runtime/gomaxprocs_windows_test.go b/src/runtime/gomaxprocs_windows_test.go index caa3e0cf8a..34e6ba5840 100644 --- a/src/runtime/gomaxprocs_windows_test.go +++ b/src/runtime/gomaxprocs_windows_test.go @@ -32,7 +32,7 @@ func TestCgroupGOMAXPROCSDontUpdate(t *testing.T) { // update feature. for _, v := range []string{"GOMAXPROCS=4", "GODEBUG=updatemaxprocs=0"} { t.Run(v, func(t *testing.T) { - got := runTestProg(t, "testprog", "WindowsUpdateGOMAXPROCS", v) + got := runTestProg(t, "testprog", "WindowsDontUpdateGOMAXPROCS", v) if strings.Contains(got, "SKIP") { t.Skip(got) } diff --git a/src/runtime/testdata/testprog/gomaxprocs_windows.go b/src/runtime/testdata/testprog/gomaxprocs_windows.go index bc7a4b1063..cae9dba8b3 100644 --- a/src/runtime/testdata/testprog/gomaxprocs_windows.go +++ b/src/runtime/testdata/testprog/gomaxprocs_windows.go @@ -56,8 +56,8 @@ func WindowsUpdateGOMAXPROCS() { } func WindowsDontUpdateGOMAXPROCS() { - ncpu := runtime.NumCPU() + procs := runtime.GOMAXPROCS(0) setAffinity2() - mustNotChangeMaxProcs(ncpu) + mustNotChangeMaxProcs(procs) println("OK") }