spatial/barneshut: make tests parallel
MODIFY
spatial/barneshut/barneshut2_test.go
spatial/barneshut/barneshut2_test.go
@@ -342,6 +342,7 @@ var planeTests = []struct {
}
func TestPlane(t *testing.T) {
+ t.Parallel()
const tol = 1e-15
for _, test := range planeTests {
@@ -408,6 +409,7 @@ func walkPlane(t *tile, fn func(*tile)) {
}
func TestPlaneForceOn(t *testing.T) {
+ t.Parallel()
const (
size = 1000
tol = 0.07
@@ -436,7 +438,9 @@ func TestPlaneForceOn(t *testing.T) {
continue
}
for _, theta := range []float64{0, 0.3, 0.6, 0.9} {
+ theta := theta
t.Run(fmt.Sprintf("%d-body/theta=%v", len(particles), theta), func(t *testing.T) {
+ t.Parallel()
var ssd, sd float64
var calls int
for i, p := range particles {

MODIFY
spatial/barneshut/barneshut3_test.go
spatial/barneshut/barneshut3_test.go
@@ -337,6 +337,7 @@ var volumeTests = []struct {
}
func TestVolume(t *testing.T) {
+ t.Parallel()
const tol = 1e-15
for _, test := range volumeTests {
@@ -405,6 +406,7 @@ func walkVolume(t *bucket, fn func(*bucket)) {
}
func TestVolumeForceOn(t *testing.T) {
+ t.Parallel()
const (
size = 1000
tol = 1e-3
@@ -433,7 +435,9 @@ func TestVolumeForceOn(t *testing.T) {
continue
}
for _, theta := range []float64{0, 0.3, 0.6, 0.9} {
+ theta := theta
t.Run(fmt.Sprintf("%d-body/theta=%v", len(particles), theta), func(t *testing.T) {
+ t.Parallel()
var ssd, sd float64
var calls int
for i, p := range particles {

spatial/barneshut: make tests parallel