mirror of
https://github.com/golang/sys.git
synced 2026-02-08 11:46:04 +03:00
unix: skip SchedAffinity test on single CPU system
Because you can't bind a thread to the second CPU if it's not there. Change-Id: I2af4e66667711dc9a3aa23fee073a70cdc5fdd4d Reviewed-on: https://go-review.googlesource.com/99355 Run-TryBot: Michael Hudson-Doyle <michael.hudson@canonical.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
This commit is contained in:
committed by
Brad Fitzpatrick
parent
dd2ff4accc
commit
349b81fb5c
@@ -292,6 +292,10 @@ func TestSchedSetaffinity(t *testing.T) {
|
||||
t.Errorf("CpuClr: didn't clear CPU %d in set: %v", cpu, newMask)
|
||||
}
|
||||
|
||||
if runtime.NumCPU() < 2 {
|
||||
t.Skip("skipping setaffinity tests on single CPU system")
|
||||
}
|
||||
|
||||
err = unix.SchedSetaffinity(0, &newMask)
|
||||
if err != nil {
|
||||
t.Fatalf("SchedSetaffinity: %v", err)
|
||||
|
||||
Reference in New Issue
Block a user