dataproc/quickstart: add test retries
@@ -140,6 +140,7 @@ func TestQuickstart(t *testing.T) {
t.Fatalf("failed to build app")
}
+ testutil.Retry(t, 3, 30*time.Second, func(r *testutil.R) {
stdOut, stdErr, err := m.Run(nil, 10*time.Minute,
"--project_id", tc.ProjectID,
"--region", region,
@@ -147,9 +148,10 @@ func TestQuickstart(t *testing.T) {
"--job_file_path", jobFilePath,
)
if err != nil {
- t.Errorf("stdout: %v", string(stdOut))
- t.Errorf("stderr: %v", string(stdErr))
- t.Errorf("execution failed: %v", err)
+ r.Errorf("stdout: %v", string(stdOut))
+ r.Errorf("stderr: %v", string(stdErr))
+ r.Errorf("execution failed: %v", err)
+ return
}
got := string(stdOut)
@@ -161,7 +163,8 @@ func TestQuickstart(t *testing.T) {
}
for _, want := range wants {
if !strings.Contains(got, want) {
- t.Errorf("got %q, want to contain %q", got, want)
+ r.Errorf("got %q, want to contain %q", got, want)
}
}
+ })
}
