Skip to content

Commit

Permalink
Added IAM propagation delay to TestAccDataprocCluster_withServiceAcc (G…
Browse files Browse the repository at this point in the history
  • Loading branch information
melinath authored Apr 11, 2024
1 parent 16d466f commit 66d7504
Showing 1 changed file with 11 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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{
{
Expand Down Expand Up @@ -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"
Expand Down Expand Up @@ -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)
}
Expand Down

0 comments on commit 66d7504

Please sign in to comment.