Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Address dependency issues in TestAccFirestoreField_* tests #9957

Merged
merged 10 commits into from
Mar 5, 2024
Original file line number Diff line number Diff line change
Expand Up @@ -83,18 +83,26 @@ resource "google_project" "project" {
org_id = "%{org_id}"
}

resource "time_sleep" "wait_60_seconds" {
# 60s wait between creating the project and enabling the service
resource "time_sleep" "wait_60_sec_after_project" {
depends_on = [google_project.project]

create_duration = "60s"
}

# 60s wait between enabling the service and trying to use it
resource "time_sleep" "wait_60_sec_after_service" {
depends_on = [google_project_service.firestore]

create_duration = "60s"
}

resource "google_project_service" "firestore" {
project = google_project.project.project_id
service = "firestore.googleapis.com"

# Needed for CI tests for permissions to propagate, should not be needed for actual usage
depends_on = [time_sleep.wait_60_seconds]
depends_on = [time_sleep.wait_60_sec_after_project]
}

resource "google_firestore_database" "database" {
Expand All @@ -103,7 +111,7 @@ resource "google_firestore_database" "database" {
location_id = "nam5"
type = "FIRESTORE_NATIVE"

depends_on = [google_project_service.firestore]
depends_on = [time_sleep.wait_60_sec_after_service]
}
`, context)
} else {
Expand Down
Loading