healthcare: delete test deid dataset
@@ -34,7 +34,7 @@ func TestDataset(t *testing.T) {
datasetID := "my-dataset"
deidentifiedDatasetID := "my-dataset-deidentified"
- // Delete test dataset if it already exists.
+ // Delete test datasets if they already exist.
if err := getDataset(buf, tc.ProjectID, location, datasetID); err == nil {
testutil.Retry(t, 10, time.Second, func(r *testutil.R) {
if err := deleteDataset(ioutil.Discard, tc.ProjectID, location, datasetID); err != nil {
@@ -42,6 +42,13 @@ func TestDataset(t *testing.T) {
}
})
}
+ if err := getDataset(buf, tc.ProjectID, location, deidentifiedDatasetID); err == nil {
+ testutil.Retry(t, 10, time.Second, func(r *testutil.R) {
+ if err := deleteDataset(ioutil.Discard, tc.ProjectID, location, deidentifiedDatasetID); err != nil {
+ r.Errorf("deleteDataset got err: %v", err)
+ }
+ })
+ }
if err := createDataset(buf, tc.ProjectID, location, datasetID); err != nil {
t.Fatalf("createDataset got err: %v", err)
