]> Cypherpunks repositories - gostls13.git/commitdiff
runtime: use DontUpdate testprog for DontUpdate test
authorMichael Pratt <mpratt@google.com>
Wed, 21 May 2025 18:49:40 +0000 (14:49 -0400)
committerGopher Robot <gobot@golang.org>
Wed, 21 May 2025 20:00:42 +0000 (13:00 -0700)
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 <mpratt@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
src/runtime/gomaxprocs_windows_test.go
src/runtime/testdata/testprog/gomaxprocs_windows.go

index caa3e0cf8acaec7388c7888828e1dde69c744760..34e6ba5840dbfa0e3a40ba12988c87cc3be61161 100644 (file)
@@ -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)
                        }
index bc7a4b1063087f47afbc5189c1b3759857c78ce9..cae9dba8b3afd852b1888d0dcafb2223ae683a59 100644 (file)
@@ -56,8 +56,8 @@ func WindowsUpdateGOMAXPROCS() {
 }
 
 func WindowsDontUpdateGOMAXPROCS() {
-       ncpu := runtime.NumCPU()
+       procs := runtime.GOMAXPROCS(0)
        setAffinity2()
-       mustNotChangeMaxProcs(ncpu)
+       mustNotChangeMaxProcs(procs)
        println("OK")
 }