Revert "Make lots of tests run in parallel"

This reverts commit 323dc60712.

Reason for revert: Possible cause of test instability
Bug: 170513220
Test: soong tests

Change-Id: Iee168e9fbb4210569e6cffcc23e60d111403abb8
This commit is contained in:
Colin Cross
2020-10-10 01:30:30 +00:00
parent 6682ef42a4
commit 405af07859
116 changed files with 0 additions and 660 deletions

View File

@@ -68,7 +68,6 @@ func customModuleFactory() Module {
}
func TestAndroidMkSingleton_PassesUpdatedAndroidMkDataToCustomCallback(t *testing.T) {
t.Parallel()
bp := `
custom {
name: "foo",
@@ -104,7 +103,6 @@ func TestAndroidMkSingleton_PassesUpdatedAndroidMkDataToCustomCallback(t *testin
}
func TestGetDistForGoals(t *testing.T) {
t.Parallel()
testCases := []struct {
bp string
expectedAndroidMkLines []string

View File

@@ -20,7 +20,6 @@ import (
)
func Test_mergeApexVariations(t *testing.T) {
t.Parallel()
tests := []struct {
name string
in []ApexInfo

View File

@@ -36,7 +36,6 @@ type NamedNoneFiltered struct {
}
func TestFilterArchStruct(t *testing.T) {
t.Parallel()
tests := []struct {
name string
in interface{}
@@ -275,7 +274,6 @@ func archTestModuleFactory() Module {
}
func TestArchMutator(t *testing.T) {
t.Parallel()
var buildOSVariants []string
var buildOS32Variants []string
switch runtime.GOOS {
@@ -387,7 +385,6 @@ func TestArchMutator(t *testing.T) {
}
func TestArchMutatorNativeBridge(t *testing.T) {
t.Parallel()
bp := `
// This module is only enabled for x86.
module {

View File

@@ -58,7 +58,6 @@ func (c *configType) SetDefaultConfig() {
// tests that ValidateConfigAnnotation works
func TestValidateConfigAnnotations(t *testing.T) {
t.Parallel()
config := configType{}
err := validateConfigAnnotations(&config)
expectedError := `Field configType.PopulateMe has tag json:"omitempty" which specifies to change its json field name to "omitempty".
@@ -75,7 +74,6 @@ Did you mean to use an annotation of ",omitempty"?
// run validateConfigAnnotations against each type that might have json annotations
func TestProductConfigAnnotations(t *testing.T) {
t.Parallel()
err := validateConfigAnnotations(&productVariables{})
if err != nil {
t.Errorf(err.Error())
@@ -88,7 +86,6 @@ func TestProductConfigAnnotations(t *testing.T) {
}
func TestMissingVendorConfig(t *testing.T) {
t.Parallel()
c := &config{}
if c.VendorConfig("test").Bool("not_set") {
t.Errorf("Expected false")

View File

@@ -32,7 +32,6 @@ func testCSuiteConfig(test *testing.T, bpFileContents string) *TestContext {
}
func TestCSuiteConfig(t *testing.T) {
t.Parallel()
ctx := testCSuiteConfig(t, `
csuite_config { name: "plain"}
csuite_config { name: "with_manifest", test_config: "manifest.xml" }

View File

@@ -59,7 +59,6 @@ func defaultsTestDefaultsFactory() Module {
}
func TestDefaults(t *testing.T) {
t.Parallel()
bp := `
defaults {
name: "transitive",
@@ -103,7 +102,6 @@ func TestDefaults(t *testing.T) {
}
func TestDefaultsAllowMissingDependencies(t *testing.T) {
t.Parallel()
bp := `
defaults {
name: "defaults",

View File

@@ -64,7 +64,6 @@ func ExampleDepSet_ToSortedList() {
// Tests based on Bazel's ExpanderTestBase.java to ensure compatibility
// https://github.com/bazelbuild/bazel/blob/master/src/test/java/com/google/devtools/build/lib/collect/nestedset/ExpanderTestBase.java
func TestDepSet(t *testing.T) {
t.Parallel()
a := PathForTesting("a")
b := PathForTesting("b")
c := PathForTesting("c")
@@ -275,7 +274,6 @@ func TestDepSet(t *testing.T) {
}
func TestDepSetInvalidOrder(t *testing.T) {
t.Parallel()
orders := []DepSetOrder{POSTORDER, PREORDER, TOPOLOGICAL}
run := func(t *testing.T, order1, order2 DepSetOrder) {

View File

@@ -163,7 +163,6 @@ var expandTestCases = []struct {
}
func TestExpand(t *testing.T) {
t.Parallel()
for _, test := range expandTestCases {
got, err := Expand(test.in, func(s string) (string, error) {
s, _, err := expander(s)
@@ -180,7 +179,6 @@ func TestExpand(t *testing.T) {
}
func TestExpandNinjaEscaped(t *testing.T) {
t.Parallel()
for _, test := range expandTestCases {
got, err := ExpandNinjaEscaped(test.in, expander)
if err != nil && !test.err {

View File

@@ -19,7 +19,6 @@ import (
)
func TestSrcIsModule(t *testing.T) {
t.Parallel()
type args struct {
s string
}
@@ -67,7 +66,6 @@ func TestSrcIsModule(t *testing.T) {
}
func TestSrcIsModuleWithTag(t *testing.T) {
t.Parallel()
type args struct {
s string
}
@@ -166,7 +164,6 @@ func depsModuleFactory() Module {
}
func TestErrorDependsOnDisabledModule(t *testing.T) {
t.Parallel()
ctx := NewTestContext()
ctx.RegisterModuleType("deps", depsModuleFactory)

View File

@@ -59,7 +59,6 @@ func addMissingDependenciesMutator(ctx TopDownMutatorContext) {
}
func TestMutatorAddMissingDependencies(t *testing.T) {
t.Parallel()
bp := `
test {
name: "foo",
@@ -93,7 +92,6 @@ func TestMutatorAddMissingDependencies(t *testing.T) {
}
func TestModuleString(t *testing.T) {
t.Parallel()
ctx := NewTestContext()
var moduleStrings []string
@@ -192,7 +190,6 @@ func TestModuleString(t *testing.T) {
}
func TestFinalDepsPhase(t *testing.T) {
t.Parallel()
ctx := NewTestContext()
finalGot := map[string]int{}
@@ -270,7 +267,6 @@ func TestFinalDepsPhase(t *testing.T) {
}
func TestNoCreateVariationsInFinalDeps(t *testing.T) {
t.Parallel()
ctx := NewTestContext()
checkErr := func() {

View File

@@ -24,7 +24,6 @@ import (
)
func TestDependingOnModuleInSameNamespace(t *testing.T) {
t.Parallel()
ctx := setupTest(t,
map[string]string{
"dir1": `
@@ -49,7 +48,6 @@ func TestDependingOnModuleInSameNamespace(t *testing.T) {
}
func TestDependingOnModuleInRootNamespace(t *testing.T) {
t.Parallel()
ctx := setupTest(t,
map[string]string{
".": `
@@ -72,7 +70,6 @@ func TestDependingOnModuleInRootNamespace(t *testing.T) {
}
func TestImplicitlyImportRootNamespace(t *testing.T) {
t.Parallel()
_ = setupTest(t,
map[string]string{
".": `
@@ -95,7 +92,6 @@ func TestImplicitlyImportRootNamespace(t *testing.T) {
}
func TestDependingOnBlueprintModuleInRootNamespace(t *testing.T) {
t.Parallel()
_ = setupTest(t,
map[string]string{
".": `
@@ -118,7 +114,6 @@ func TestDependingOnBlueprintModuleInRootNamespace(t *testing.T) {
}
func TestDependingOnModuleInImportedNamespace(t *testing.T) {
t.Parallel()
ctx := setupTest(t,
map[string]string{
"dir1": `
@@ -148,7 +143,6 @@ func TestDependingOnModuleInImportedNamespace(t *testing.T) {
}
func TestDependingOnModuleInNonImportedNamespace(t *testing.T) {
t.Parallel()
_, errs := setupTestExpectErrs(
map[string]string{
"dir1": `
@@ -189,7 +183,6 @@ Module "a" can be found in these namespaces: ["dir1" "dir2"]`),
}
func TestDependingOnModuleByFullyQualifiedReference(t *testing.T) {
t.Parallel()
ctx := setupTest(t,
map[string]string{
"dir1": `
@@ -217,7 +210,6 @@ func TestDependingOnModuleByFullyQualifiedReference(t *testing.T) {
}
func TestSameNameInTwoNamespaces(t *testing.T) {
t.Parallel()
ctx := setupTest(t,
map[string]string{
"dir1": `
@@ -268,7 +260,6 @@ func TestSameNameInTwoNamespaces(t *testing.T) {
}
func TestSearchOrder(t *testing.T) {
t.Parallel()
ctx := setupTest(t,
map[string]string{
"dir1": `
@@ -357,7 +348,6 @@ func TestSearchOrder(t *testing.T) {
}
func TestTwoNamespacesCanImportEachOther(t *testing.T) {
t.Parallel()
_ = setupTest(t,
map[string]string{
"dir1": `
@@ -388,7 +378,6 @@ func TestTwoNamespacesCanImportEachOther(t *testing.T) {
}
func TestImportingNonexistentNamespace(t *testing.T) {
t.Parallel()
_, errs := setupTestExpectErrs(
map[string]string{
"dir1": `
@@ -413,7 +402,6 @@ func TestImportingNonexistentNamespace(t *testing.T) {
}
func TestNamespacesDontInheritParentNamespaces(t *testing.T) {
t.Parallel()
_, errs := setupTestExpectErrs(
map[string]string{
"dir1": `
@@ -445,7 +433,6 @@ Module "a" can be found in these namespaces: ["dir1"]`),
}
func TestModulesDoReceiveParentNamespace(t *testing.T) {
t.Parallel()
_ = setupTest(t,
map[string]string{
"dir1": `
@@ -468,7 +455,6 @@ func TestModulesDoReceiveParentNamespace(t *testing.T) {
}
func TestNamespaceImportsNotTransitive(t *testing.T) {
t.Parallel()
_, errs := setupTestExpectErrs(
map[string]string{
"dir1": `
@@ -510,7 +496,6 @@ Module "a" can be found in these namespaces: ["dir1"]`),
}
func TestTwoNamepacesInSameDir(t *testing.T) {
t.Parallel()
_, errs := setupTestExpectErrs(
map[string]string{
"dir1": `
@@ -531,7 +516,6 @@ func TestTwoNamepacesInSameDir(t *testing.T) {
}
func TestNamespaceNotAtTopOfFile(t *testing.T) {
t.Parallel()
_, errs := setupTestExpectErrs(
map[string]string{
"dir1": `
@@ -553,7 +537,6 @@ func TestNamespaceNotAtTopOfFile(t *testing.T) {
}
func TestTwoModulesWithSameNameInSameNamespace(t *testing.T) {
t.Parallel()
_, errs := setupTestExpectErrs(
map[string]string{
"dir1": `
@@ -579,7 +562,6 @@ func TestTwoModulesWithSameNameInSameNamespace(t *testing.T) {
}
func TestDeclaringNamespaceInNonAndroidBpFile(t *testing.T) {
t.Parallel()
_, errs := setupTestFromFiles(
map[string][]byte{
"Android.bp": []byte(`
@@ -603,7 +585,6 @@ func TestDeclaringNamespaceInNonAndroidBpFile(t *testing.T) {
// so that the generated .ninja file will have consistent names
func TestConsistentNamespaceNames(t *testing.T) {
t.Parallel()
ctx := setupTest(t,
map[string]string{
"dir1": "soong_namespace{}",
@@ -623,7 +604,6 @@ func TestConsistentNamespaceNames(t *testing.T) {
// so that the generated .ninja file will have consistent names
func TestRename(t *testing.T) {
t.Parallel()
_ = setupTest(t,
map[string]string{
"dir1": `

View File

@@ -343,7 +343,6 @@ var neverallowTests = []struct {
}
func TestNeverallow(t *testing.T) {
t.Parallel()
for _, test := range neverallowTests {
// Create a test per config to allow for test specific config, e.g. test rules.
config := TestConfig(buildDir, nil, "", test.fs)

View File

@@ -20,7 +20,6 @@ import (
)
func TestOncePer_Once(t *testing.T) {
t.Parallel()
once := OncePer{}
key := NewOnceKey("key")
@@ -37,7 +36,6 @@ func TestOncePer_Once(t *testing.T) {
}
func TestOncePer_Once_wait(t *testing.T) {
t.Parallel()
once := OncePer{}
key := NewOnceKey("key")
@@ -53,7 +51,6 @@ func TestOncePer_Once_wait(t *testing.T) {
}
func TestOncePer_Get(t *testing.T) {
t.Parallel()
once := OncePer{}
key := NewOnceKey("key")
@@ -70,7 +67,6 @@ func TestOncePer_Get(t *testing.T) {
}
func TestOncePer_Get_panic(t *testing.T) {
t.Parallel()
once := OncePer{}
key := NewOnceKey("key")
@@ -86,7 +82,6 @@ func TestOncePer_Get_panic(t *testing.T) {
}
func TestOncePer_Get_wait(t *testing.T) {
t.Parallel()
once := OncePer{}
key := NewOnceKey("key")
@@ -102,7 +97,6 @@ func TestOncePer_Get_wait(t *testing.T) {
}
func TestOncePer_OnceStringSlice(t *testing.T) {
t.Parallel()
once := OncePer{}
key := NewOnceKey("key")
@@ -119,7 +113,6 @@ func TestOncePer_OnceStringSlice(t *testing.T) {
}
func TestOncePer_Once2StringSlice(t *testing.T) {
t.Parallel()
once := OncePer{}
key := NewOnceKey("key")
@@ -136,7 +129,6 @@ func TestOncePer_Once2StringSlice(t *testing.T) {
}
func TestNewOnceKey(t *testing.T) {
t.Parallel()
once := OncePer{}
key1 := NewOnceKey("key")
key2 := NewOnceKey("key")
@@ -154,7 +146,6 @@ func TestNewOnceKey(t *testing.T) {
}
func TestNewCustomOnceKey(t *testing.T) {
t.Parallel()
type key struct {
key string
}
@@ -175,7 +166,6 @@ func TestNewCustomOnceKey(t *testing.T) {
}
func TestOncePerReentrant(t *testing.T) {
t.Parallel()
once := OncePer{}
key1 := NewOnceKey("key")
key2 := NewOnceKey("key")
@@ -188,7 +178,6 @@ func TestOncePerReentrant(t *testing.T) {
// Test that a recovered panic in a Once function doesn't deadlock
func TestOncePerPanic(t *testing.T) {
t.Parallel()
once := OncePer{}
key := NewOnceKey("key")

View File

@@ -56,7 +56,6 @@ var packageTests = []struct {
}
func TestPackage(t *testing.T) {
t.Parallel()
for _, test := range packageTests {
t.Run(test.name, func(t *testing.T) {
_, errs := testPackage(test.fs)

View File

@@ -59,7 +59,6 @@ func (p *pathDepsMutatorTestModule) GenerateAndroidBuildActions(ctx ModuleContex
}
func TestPathDepsMutator(t *testing.T) {
t.Parallel()
tests := []struct {
name string
bp string

View File

@@ -110,7 +110,6 @@ var validatePathTestCases = append(commonValidatePathTestCases, []strsTestCase{
}...)
func TestValidateSafePath(t *testing.T) {
t.Parallel()
for _, testCase := range validateSafePathTestCases {
t.Run(strings.Join(testCase.in, ","), func(t *testing.T) {
ctx := &configErrorWrapper{}
@@ -124,7 +123,6 @@ func TestValidateSafePath(t *testing.T) {
}
func TestValidatePath(t *testing.T) {
t.Parallel()
for _, testCase := range validatePathTestCases {
t.Run(strings.Join(testCase.in, ","), func(t *testing.T) {
ctx := &configErrorWrapper{}
@@ -138,7 +136,6 @@ func TestValidatePath(t *testing.T) {
}
func TestOptionalPath(t *testing.T) {
t.Parallel()
var path OptionalPath
checkInvalidOptionalPath(t, path)
@@ -256,7 +253,6 @@ func pathTestConfig(buildDir string) Config {
}
func TestPathForModuleInstall(t *testing.T) {
t.Parallel()
testConfig := pathTestConfig("")
hostTarget := Target{Os: Linux, Arch: Arch{ArchType: X86}}
@@ -661,7 +657,6 @@ func TestPathForModuleInstall(t *testing.T) {
}
func TestDirectorySortedPaths(t *testing.T) {
t.Parallel()
config := TestConfig("out", nil, "", map[string][]byte{
"Android.bp": nil,
"a.txt": nil,
@@ -744,7 +739,6 @@ func TestDirectorySortedPaths(t *testing.T) {
}
func TestMaybeRel(t *testing.T) {
t.Parallel()
testCases := []struct {
name string
base string
@@ -802,7 +796,6 @@ func TestMaybeRel(t *testing.T) {
}
func TestPathForSource(t *testing.T) {
t.Parallel()
testCases := []struct {
name string
buildDir string
@@ -1035,7 +1028,6 @@ func testPathForModuleSrc(t *testing.T, buildDir string, tests []pathForModuleSr
}
func TestPathsForModuleSrc(t *testing.T) {
t.Parallel()
tests := []pathForModuleSrcTestCase{
{
name: "path",
@@ -1131,7 +1123,6 @@ func TestPathsForModuleSrc(t *testing.T) {
}
func TestPathForModuleSrc(t *testing.T) {
t.Parallel()
tests := []pathForModuleSrcTestCase{
{
name: "path",
@@ -1199,7 +1190,6 @@ func TestPathForModuleSrc(t *testing.T) {
}
func TestPathsForModuleSrc_AllowMissingDependencies(t *testing.T) {
t.Parallel()
bp := `
test {
name: "foo",

View File

@@ -262,7 +262,6 @@ var prebuiltsTests = []struct {
}
func TestPrebuilts(t *testing.T) {
t.Parallel()
fs := map[string][]byte{
"prebuilt_file": nil,
"source_file": nil,

View File

@@ -264,7 +264,6 @@ func ExampleRuleBuilderCommand_NinjaEscapedString() {
}
func TestRuleBuilder(t *testing.T) {
t.Parallel()
fs := map[string][]byte{
"dep_fixer": nil,
"input": nil,
@@ -456,7 +455,6 @@ func testRuleBuilder_Build(ctx BuilderContext, in Path, out, outDep, outDir Writ
}
func TestRuleBuilder_Build(t *testing.T) {
t.Parallel()
fs := map[string][]byte{
"bar": nil,
"cp": nil,
@@ -548,7 +546,6 @@ func TestRuleBuilder_Build(t *testing.T) {
}
func Test_ninjaEscapeExceptForSpans(t *testing.T) {
t.Parallel()
type args struct {
s string
spans [][2]int

View File

@@ -38,7 +38,6 @@ func soongConfigTestModuleFactory() Module {
func (t soongConfigTestModule) GenerateAndroidBuildActions(ModuleContext) {}
func TestSoongConfigModule(t *testing.T) {
t.Parallel()
configBp := `
soong_config_module_type {
name: "acme_test_defaults",

View File

@@ -20,7 +20,6 @@ import (
)
func Test_CanonicalizeToProperty(t *testing.T) {
t.Parallel()
tests := []struct {
name string
arg string
@@ -67,7 +66,6 @@ func Test_CanonicalizeToProperty(t *testing.T) {
}
func Test_typeForPropertyFromPropertyStruct(t *testing.T) {
t.Parallel()
tests := []struct {
name string
ps interface{}
@@ -188,7 +186,6 @@ func Test_typeForPropertyFromPropertyStruct(t *testing.T) {
}
func Test_createAffectablePropertiesType(t *testing.T) {
t.Parallel()
tests := []struct {
name string
affectableProperties []string

View File

@@ -60,7 +60,6 @@ var firstUniqueStringsTestCases = []struct {
}
func TestFirstUniqueStrings(t *testing.T) {
t.Parallel()
f := func(t *testing.T, imp func([]string) []string, in, want []string) {
t.Helper()
out := imp(in)
@@ -121,7 +120,6 @@ var lastUniqueStringsTestCases = []struct {
}
func TestLastUniqueStrings(t *testing.T) {
t.Parallel()
for _, testCase := range lastUniqueStringsTestCases {
out := LastUniqueStrings(testCase.in)
if !reflect.DeepEqual(out, testCase.out) {
@@ -134,7 +132,6 @@ func TestLastUniqueStrings(t *testing.T) {
}
func TestJoinWithPrefix(t *testing.T) {
t.Parallel()
testcases := []struct {
name string
input []string
@@ -174,7 +171,6 @@ func TestJoinWithPrefix(t *testing.T) {
}
func TestIndexList(t *testing.T) {
t.Parallel()
input := []string{"a", "b", "c"}
testcases := []struct {
@@ -214,7 +210,6 @@ func TestIndexList(t *testing.T) {
}
func TestInList(t *testing.T) {
t.Parallel()
input := []string{"a"}
testcases := []struct {
@@ -246,7 +241,6 @@ func TestInList(t *testing.T) {
}
func TestPrefixInList(t *testing.T) {
t.Parallel()
prefixes := []string{"a", "b"}
testcases := []struct {
@@ -282,7 +276,6 @@ func TestPrefixInList(t *testing.T) {
}
func TestFilterList(t *testing.T) {
t.Parallel()
input := []string{"a", "b", "c", "c", "b", "d", "a"}
filter := []string{"a", "c"}
remainder, filtered := FilterList(input, filter)
@@ -307,7 +300,6 @@ func TestFilterList(t *testing.T) {
}
func TestRemoveListFromList(t *testing.T) {
t.Parallel()
input := []string{"a", "b", "c", "d", "a", "c", "d"}
filter := []string{"a", "c"}
expected := []string{"b", "d", "d"}
@@ -322,7 +314,6 @@ func TestRemoveListFromList(t *testing.T) {
}
func TestRemoveFromList(t *testing.T) {
t.Parallel()
testcases := []struct {
name string
key string
@@ -426,7 +417,6 @@ func ExampleCopyOf_append() {
}
func TestSplitFileExt(t *testing.T) {
t.Parallel()
t.Run("soname with version", func(t *testing.T) {
root, suffix, ext := SplitFileExt("libtest.so.1.0.30")
expected := "libtest"
@@ -492,7 +482,6 @@ func TestSplitFileExt(t *testing.T) {
}
func Test_Shard(t *testing.T) {
t.Parallel()
type args struct {
strings []string
shardSize int

View File

@@ -112,7 +112,6 @@ var printfIntoPropertyTestCases = []printfIntoPropertyTestCase{
}
func TestPrintfIntoProperty(t *testing.T) {
t.Parallel()
for _, testCase := range printfIntoPropertyTestCases {
s := testCase.in
v := reflect.ValueOf(&s).Elem()
@@ -158,7 +157,6 @@ func testProductVariableModuleFactoryFactory(props interface{}) func() Module {
}
func TestProductVariables(t *testing.T) {
t.Parallel()
ctx := NewTestContext()
// A module type that has a srcs property but not a cflags property.
ctx.RegisterModuleType("module1", testProductVariableModuleFactoryFactory(&struct {
@@ -267,7 +265,6 @@ func productVariablesDefaultsTestDefaultsFactory() Module {
// Test a defaults module that supports more product variable properties than the target module.
func TestProductVariablesDefaults(t *testing.T) {
t.Parallel()
bp := `
defaults {
name: "defaults",

View File

@@ -1140,7 +1140,6 @@ var visibilityTests = []struct {
}
func TestVisibility(t *testing.T) {
t.Parallel()
for _, test := range visibilityTests {
t.Run(test.name, func(t *testing.T) {
ctx, errs := testVisibility(buildDir, test.fs)