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:
@@ -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)
|
||||
|
Reference in New Issue
Block a user