diff options
author | Mikio Hara <mikioh.mikioh@gmail.com> | 2012-03-07 14:51:20 +0900 |
---|---|---|
committer | Mikio Hara <mikioh.mikioh@gmail.com> | 2012-03-07 14:51:20 +0900 |
commit | 0393b6fd2cb42c0a64b7951daec1137dde59a19b (patch) | |
tree | ffdb33b64689a63746ac905062ebee37f2bab148 /src/pkg/sync | |
parent | 914b90783216e1a2a33a088b6b74c5acdf3bb182 (diff) | |
download | go-0393b6fd2cb42c0a64b7951daec1137dde59a19b.tar.gz |
sync/atomic: disable store and load test on a single processor machine
Fixes issue 3226.
R=golang-dev, rsc
CC=golang-dev
http://codereview.appspot.com/5756073
Diffstat (limited to 'src/pkg/sync')
-rw-r--r-- | src/pkg/sync/atomic/atomic_test.go | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/pkg/sync/atomic/atomic_test.go b/src/pkg/sync/atomic/atomic_test.go index a06c85c3a..f60d997ce 100644 --- a/src/pkg/sync/atomic/atomic_test.go +++ b/src/pkg/sync/atomic/atomic_test.go @@ -1012,6 +1012,10 @@ func TestHammerStoreLoad(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)) N := int32(1e3) if testing.Short() { @@ -1049,6 +1053,10 @@ func TestStoreLoadSeqCst32(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 { t.Logf("Skipping 64-bit tests: %v", test64err) return @@ -1090,6 +1098,10 @@ func TestStoreLoadSeqCst64(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)) N := int32(1e3) if testing.Short() { @@ -1132,6 +1144,10 @@ func TestStoreLoadRelAcq32(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 { t.Logf("Skipping 64-bit tests: %v", test64err) return |