diff --git a/mmv1/third_party/terraform/services/dataproc/resource_dataproc_cluster_test.go.erb b/mmv1/third_party/terraform/services/dataproc/resource_dataproc_cluster_test.go.erb index 74c3161ad3a0..4d93951d63df 100644 --- a/mmv1/third_party/terraform/services/dataproc/resource_dataproc_cluster_test.go.erb +++ b/mmv1/third_party/terraform/services/dataproc/resource_dataproc_cluster_test.go.erb @@ -702,6 +702,9 @@ func TestAccDataprocCluster_withServiceAcc(t *testing.T) { acctest.VcrTest(t, resource.TestCase{ PreCheck: func() { acctest.AccTestPreCheck(t) }, ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories(t), + ExternalProviders: map[string]resource.ExternalProvider{ + "time": {}, + }, CheckDestroy: testAccCheckDataprocClusterDestroy(t), Steps: []resource.TestStep{ { @@ -2224,6 +2227,13 @@ resource "google_project_iam_member" "service_account" { member = "serviceAccount:${google_service_account.service_account.email}" } +# Wait for IAM propagation +resource "time_sleep" "wait_120_seconds" { + depends_on = [google_project_iam_member.service_account] + + create_duration = "120s" +} + resource "google_dataproc_cluster" "with_service_account" { name = "dproc-cluster-test-%s" region = "us-central1" @@ -2261,7 +2271,7 @@ resource "google_dataproc_cluster" "with_service_account" { } } - depends_on = [google_project_iam_member.service_account] + depends_on = [time_sleep.wait_120_seconds] } `, sa, rnd, subnetworkName) }