1
0
mirror of https://github.com/golang/go synced 2024-11-22 10:34:46 -07:00

sync/atomic: disable store and load test on a single processor machine

Fixes #3226.

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5756073
This commit is contained in:
Mikio Hara 2012-03-07 14:51:20 +09:00
parent c804efb5de
commit e2b207bc4f

View File

@ -1012,6 +1012,10 @@ func TestHammerStoreLoad(t *testing.T) {
} }
func TestStoreLoadSeqCst32(t *testing.T) { func TestStoreLoadSeqCst32(t *testing.T) {
if runtime.NumCPU() == 1 {
t.Logf("Skipping test on %v processor machine", runtime.NumCPU())
return
}
defer runtime.GOMAXPROCS(runtime.GOMAXPROCS(4)) defer runtime.GOMAXPROCS(runtime.GOMAXPROCS(4))
N := int32(1e3) N := int32(1e3)
if testing.Short() { if testing.Short() {
@ -1049,6 +1053,10 @@ func TestStoreLoadSeqCst32(t *testing.T) {
} }
func TestStoreLoadSeqCst64(t *testing.T) { func TestStoreLoadSeqCst64(t *testing.T) {
if runtime.NumCPU() == 1 {
t.Logf("Skipping test on %v processor machine", runtime.NumCPU())
return
}
if test64err != nil { if test64err != nil {
t.Logf("Skipping 64-bit tests: %v", test64err) t.Logf("Skipping 64-bit tests: %v", test64err)
return return
@ -1090,6 +1098,10 @@ func TestStoreLoadSeqCst64(t *testing.T) {
} }
func TestStoreLoadRelAcq32(t *testing.T) { func TestStoreLoadRelAcq32(t *testing.T) {
if runtime.NumCPU() == 1 {
t.Logf("Skipping test on %v processor machine", runtime.NumCPU())
return
}
defer runtime.GOMAXPROCS(runtime.GOMAXPROCS(4)) defer runtime.GOMAXPROCS(runtime.GOMAXPROCS(4))
N := int32(1e3) N := int32(1e3)
if testing.Short() { if testing.Short() {
@ -1132,6 +1144,10 @@ func TestStoreLoadRelAcq32(t *testing.T) {
} }
func TestStoreLoadRelAcq64(t *testing.T) { func TestStoreLoadRelAcq64(t *testing.T) {
if runtime.NumCPU() == 1 {
t.Logf("Skipping test on %v processor machine", runtime.NumCPU())
return
}
if test64err != nil { if test64err != nil {
t.Logf("Skipping 64-bit tests: %v", test64err) t.Logf("Skipping 64-bit tests: %v", test64err)
return return