This commit is contained in:
Tejal Desai 2020-06-05 16:07:32 -07:00
parent ba00c9fb7d
commit 57818cfb79
1 changed files with 4 additions and 8 deletions

View File

@ -132,11 +132,10 @@ func TestSnapshotBenchmarkGcloud(t *testing.T) {
for _, num := range nums { for _, num := range nums {
t.Run(fmt.Sprintf("test_benchmark_%d", num), func(t *testing.T) { t.Run(fmt.Sprintf("test_benchmark_%d", num), func(t *testing.T) {
wg.Add(1) wg.Add(1)
var err error go func(num int) {
go func(num int, err error) { dir, err := runInGcloud(contextDir, num)
var dir string
dir, err = runInGcloud(contextDir, num)
if err != nil { if err != nil {
t.Errorf("error when running in gcloud %v", err)
return return
} }
r := newResult(t, filepath.Join(dir, "results")) r := newResult(t, filepath.Join(dir, "results"))
@ -144,10 +143,7 @@ func TestSnapshotBenchmarkGcloud(t *testing.T) {
wg.Done() wg.Done()
defer os.Remove(dir) defer os.Remove(dir)
defer os.Chdir(cwd) defer os.Chdir(cwd)
}(num, err) }(num)
if err != nil {
t.Errorf("could not run benchmark results for num %d due to %s", num, err)
}
}) })
} }
wg.Wait() wg.Wait()