Make lots of tests run in parallel
Putting t.Parallel() in each test makes them run in parallel.
Additional t.Parallel() could be added to each subtest, although
that requires making a local copy of the loop variable for
table driven tests.
Test: m checkbuild
Change-Id: I5d9869ead441093f4d7c5757f2447385333a95a4
diff --git a/android/onceper_test.go b/android/onceper_test.go
index 1a55ff4..da0b10d 100644
--- a/android/onceper_test.go
+++ b/android/onceper_test.go
@@ -20,6 +20,7 @@
)
func TestOncePer_Once(t *testing.T) {
+ t.Parallel()
once := OncePer{}
key := NewOnceKey("key")
@@ -36,6 +37,7 @@
}
func TestOncePer_Once_wait(t *testing.T) {
+ t.Parallel()
once := OncePer{}
key := NewOnceKey("key")
@@ -51,6 +53,7 @@
}
func TestOncePer_Get(t *testing.T) {
+ t.Parallel()
once := OncePer{}
key := NewOnceKey("key")
@@ -67,6 +70,7 @@
}
func TestOncePer_Get_panic(t *testing.T) {
+ t.Parallel()
once := OncePer{}
key := NewOnceKey("key")
@@ -82,6 +86,7 @@
}
func TestOncePer_Get_wait(t *testing.T) {
+ t.Parallel()
once := OncePer{}
key := NewOnceKey("key")
@@ -97,6 +102,7 @@
}
func TestOncePer_OnceStringSlice(t *testing.T) {
+ t.Parallel()
once := OncePer{}
key := NewOnceKey("key")
@@ -113,6 +119,7 @@
}
func TestOncePer_Once2StringSlice(t *testing.T) {
+ t.Parallel()
once := OncePer{}
key := NewOnceKey("key")
@@ -129,6 +136,7 @@
}
func TestNewOnceKey(t *testing.T) {
+ t.Parallel()
once := OncePer{}
key1 := NewOnceKey("key")
key2 := NewOnceKey("key")
@@ -146,6 +154,7 @@
}
func TestNewCustomOnceKey(t *testing.T) {
+ t.Parallel()
type key struct {
key string
}
@@ -166,6 +175,7 @@
}
func TestOncePerReentrant(t *testing.T) {
+ t.Parallel()
once := OncePer{}
key1 := NewOnceKey("key")
key2 := NewOnceKey("key")
@@ -178,6 +188,7 @@
// Test that a recovered panic in a Once function doesn't deadlock
func TestOncePerPanic(t *testing.T) {
+ t.Parallel()
once := OncePer{}
key := NewOnceKey("key")