mirror of
https://github.com/caddyserver/caddy.git
synced 2024-11-29 04:10:16 +08:00
Fix test on Windows (with 1 CPU)
This commit is contained in:
parent
e625c7c051
commit
0a3f68f0d7
5
dist/automate_test.go
vendored
5
dist/automate_test.go
vendored
|
@ -6,8 +6,9 @@ import (
|
|||
)
|
||||
|
||||
func TestNumProcs(t *testing.T) {
|
||||
num := runtime.NumCPU()
|
||||
n := numProcs()
|
||||
if n != runtime.NumCPU()-1 {
|
||||
t.Errorf("Expected numProcs to return NumCPU-1, got %d", n)
|
||||
if num > 1 && n != num-1 {
|
||||
t.Errorf("Expected numProcs to return max(NumCPU-1, 0) but got %d (NumCPU=%d)", n, num)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user