Source file
src/runtime/gomaxprocs_windows_test.go
1
2
3
4
5 package runtime_test
6
7 import (
8 "strings"
9 "testing"
10 )
11
12 func TestGOMAXPROCSUpdate(t *testing.T) {
13 if testing.Short() {
14 t.Skip("skipping test: long sleeps")
15 }
16
17 got := runTestProg(t, "testprog", "WindowsUpdateGOMAXPROCS")
18 if strings.Contains(got, "SKIP") {
19 t.Skip(got)
20 }
21 if !strings.Contains(got, "OK") {
22 t.Fatalf("output got %q want OK", got)
23 }
24 }
25
26 func TestCgroupGOMAXPROCSDontUpdate(t *testing.T) {
27 if testing.Short() {
28 t.Skip("skipping test: long sleeps")
29 }
30
31
32
33 for _, v := range []string{"GOMAXPROCS=4", "GODEBUG=updatemaxprocs=0"} {
34 t.Run(v, func(t *testing.T) {
35 got := runTestProg(t, "testprog", "WindowsDontUpdateGOMAXPROCS", v)
36 if strings.Contains(got, "SKIP") {
37 t.Skip(got)
38 }
39 if !strings.Contains(got, "OK") {
40 t.Fatalf("output got %q want OK", got)
41 }
42 })
43 }
44 }
45
View as plain text