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
This commit is contained in:
Colin Cross
2020-09-18 14:25:31 -07:00
parent 56a8321c21
commit 323dc60712
117 changed files with 661 additions and 0 deletions

View File

@@ -25,6 +25,7 @@ import (
)
func TestEnsureEmptyDirs(t *testing.T) {
t.Parallel()
ctx := testContext()
defer logger.Recover(func(err error) {
t.Error(err)
@@ -52,6 +53,7 @@ func TestEnsureEmptyDirs(t *testing.T) {
}
func TestCopyFile(t *testing.T) {
t.Parallel()
tmpDir, err := ioutil.TempDir("", "test_copy_file")
if err != nil {
t.Fatalf("failed to create temporary directory to hold test text files: %v", err)
@@ -86,6 +88,7 @@ func TestCopyFile(t *testing.T) {
}
func TestCopyFileErrors(t *testing.T) {
t.Parallel()
tmpDir, err := ioutil.TempDir("", "test_copy_file_errors")
if err != nil {
t.Fatalf("failed to create temporary directory to hold test text files: %v", err)