Make apex tests parallel
Mark all the apex tests and subtests with t.Parallel(), which will allow
the test runner to run them in parallel. Reduces the time required to
run the apex tests from 70s to 9.7s.
Test: go test ./apex
Flag: EXEMPT test only
Change-Id: I08bd3cb4d8eec1f9520c1118b4525aa79e95288e
diff --git a/apex/bootclasspath_fragment_test.go b/apex/bootclasspath_fragment_test.go
index e44d3f5..71a8246 100644
--- a/apex/bootclasspath_fragment_test.go
+++ b/apex/bootclasspath_fragment_test.go
@@ -47,6 +47,7 @@
)
func TestBootclasspathFragments_FragmentDependency(t *testing.T) {
+ t.Parallel()
result := android.GroupFixturePreparers(
prepareForTestWithBootclasspathFragment,
// Configure some libraries in the art bootclasspath_fragment and platform_bootclasspath.
@@ -178,6 +179,7 @@
}
func TestBootclasspathFragmentInArtApex(t *testing.T) {
+ t.Parallel()
commonPreparer := android.GroupFixturePreparers(
prepareForTestWithBootclasspathFragment,
prepareForTestWithArtApex,
@@ -298,6 +300,7 @@
}
t.Run("boot image files from source", func(t *testing.T) {
+ t.Parallel()
result := android.GroupFixturePreparers(
commonPreparer,
@@ -329,6 +332,7 @@
})
t.Run("boot image files from source of override apex", func(t *testing.T) {
+ t.Parallel()
result := android.GroupFixturePreparers(
commonPreparer,
@@ -349,6 +353,7 @@
})
t.Run("generate boot image profile even if dexpreopt is disabled", func(t *testing.T) {
+ t.Parallel()
result := android.GroupFixturePreparers(
commonPreparer,
@@ -369,6 +374,7 @@
})
t.Run("boot image disable generate profile", func(t *testing.T) {
+ t.Parallel()
result := android.GroupFixturePreparers(
commonPreparer,
@@ -387,6 +393,7 @@
})
t.Run("boot image files with preferred prebuilt", func(t *testing.T) {
+ t.Parallel()
result := android.GroupFixturePreparers(
commonPreparer,
@@ -431,6 +438,7 @@
})
t.Run("source with inconsistency between config and contents", func(t *testing.T) {
+ t.Parallel()
android.GroupFixturePreparers(
commonPreparer,
@@ -444,6 +452,7 @@
})
t.Run("prebuilt with inconsistency between config and contents", func(t *testing.T) {
+ t.Parallel()
android.GroupFixturePreparers(
commonPreparer,
@@ -457,6 +466,7 @@
})
t.Run("preferred prebuilt with inconsistency between config and contents", func(t *testing.T) {
+ t.Parallel()
android.GroupFixturePreparers(
commonPreparer,
@@ -473,6 +483,7 @@
})
t.Run("source preferred and prebuilt with inconsistency between config and contents", func(t *testing.T) {
+ t.Parallel()
android.GroupFixturePreparers(
commonPreparer,
@@ -491,6 +502,7 @@
}
func TestBootclasspathFragmentInPrebuiltArtApex(t *testing.T) {
+ t.Parallel()
preparers := android.GroupFixturePreparers(
prepareForTestWithBootclasspathFragment,
prepareForTestWithArtApex,
@@ -571,6 +583,7 @@
`
t.Run("disabled alternative APEX", func(t *testing.T) {
+ t.Parallel()
result := preparers.RunTestWithBp(t, fmt.Sprintf(bp, "enabled: false,"))
java.CheckModuleDependencies(t, result.TestContext, "com.android.art", "android_common_com.android.art", []string{
@@ -614,6 +627,7 @@
}
func TestBootclasspathFragmentContentsNoName(t *testing.T) {
+ t.Parallel()
result := android.GroupFixturePreparers(
prepareForTestWithBootclasspathFragment,
prepareForTestWithMyapex,
@@ -722,6 +736,7 @@
// TestBootclasspathFragment_HiddenAPIList checks to make sure that the correct parameters are
// passed to the hiddenapi list tool.
func TestBootclasspathFragment_HiddenAPIList(t *testing.T) {
+ t.Parallel()
result := android.GroupFixturePreparers(
prepareForTestWithBootclasspathFragment,
prepareForTestWithArtApex,
@@ -877,6 +892,7 @@
// additional_stubs: ["android-non-updatable"] causes the source android-non-updatable modules to be
// added to the hiddenapi list tool.
func TestBootclasspathFragment_AndroidNonUpdatable_FromSource(t *testing.T) {
+ t.Parallel()
result := android.GroupFixturePreparers(
prepareForTestWithBootclasspathFragment,
prepareForTestWithArtApex,
@@ -1050,6 +1066,7 @@
}
func TestBootclasspathFragment_AndroidNonUpdatable_FromText(t *testing.T) {
+ t.Parallel()
result := android.GroupFixturePreparers(
prepareForTestWithBootclasspathFragment,
prepareForTestWithArtApex,
@@ -1217,6 +1234,7 @@
// setting additional_stubs: ["android-non-updatable"] causes the prebuilt android-non-updatable
// modules to be added to the hiddenapi list tool.
func TestBootclasspathFragment_AndroidNonUpdatable_AlwaysUsePrebuiltSdks(t *testing.T) {
+ t.Parallel()
result := android.GroupFixturePreparers(
prepareForTestWithBootclasspathFragment,
java.PrepareForTestWithDexpreopt,
@@ -1377,6 +1395,7 @@
}
func TestBootclasspathFragmentProtoContainsMinSdkVersion(t *testing.T) {
+ t.Parallel()
result := android.GroupFixturePreparers(
prepareForTestWithBootclasspathFragment,
prepareForTestWithMyapex,