Commit 349b81fb authored by Michael Hudson-Doyle's avatar Michael Hudson-Doyle Committed by Brad Fitzpatrick

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: 's avatarBrad Fitzpatrick <bradfitz@golang.org>
parent dd2ff4ac
......@@ -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)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment