Skip to content

apigee: fix TestAccApigeeOrganization_apigeeOrganizationCloudBasicDataResidencyTestExample#16938

Closed
xuchenma wants to merge 1 commit into
GoogleCloudPlatform:mainfrom
xuchenma:413800069
Closed

apigee: fix TestAccApigeeOrganization_apigeeOrganizationCloudBasicDataResidencyTestExample#16938
xuchenma wants to merge 1 commit into
GoogleCloudPlatform:mainfrom
xuchenma:413800069

Conversation

@xuchenma

@xuchenma xuchenma commented Apr 3, 2026

Copy link
Copy Markdown
Contributor

Summary

Fixes hashicorp/terraform-provider-google#22528

The TestAccApigeeOrganization_apigeeOrganizationCloudBasicDataResidencyTestExample test was flaky because Apigee Organization deletion is asynchronous. The CheckDestroy function ran immediately after terraform destroy completed, but the org could still be in DELETING state, causing false "resource still exists" failures.

This PR applies the same fix as the sibling PR for b/463028638: override CheckDestroy with a custom polling implementation that treats both HTTP 404 and state == "DELETING" as successful deletion, polling up to 10 minutes.

Changes:

  • Added test_check_destroy to mmv1/products/apigee/Organization.yaml
  • Created mmv1/templates/terraform/custom_check_destroy/apigee_organization.go.tmpl with async-aware polling logic

Test evidence

--- PASS: TestAccApigeeOrganization_apigeeOrganizationCloudBasicDataResidencyTestExample (916.14s)
PASS
ok  	github.com/hashicorp/terraform-provider-google/google/services/apigee	916.856s
apigee: fixed flaky `google_apigee_organization` CheckDestroy caused by async organization deletion in data residency test

@modular-magician modular-magician added the awaiting-approval Pull requests that need reviewer's approval to run presubmit tests label Apr 3, 2026
@github-actions

github-actions Bot commented Apr 3, 2026

Copy link
Copy Markdown

Googlers: For automatic test runs see go/terraform-auto-test-runs.

@roaks3, a repository maintainer, has been assigned to review your changes. If you have not received review feedback within 2 business days, please leave a comment on this PR asking them to take a look.

You can help make sure that review is quick by doing a self-review and by running impacted tests locally.

@github-actions github-actions Bot requested a review from roaks3 April 3, 2026 23:56
@xuchenma

xuchenma commented Apr 4, 2026

Copy link
Copy Markdown
Contributor Author

This is not needed, #16940 fixes this issue.

@xuchenma xuchenma closed this Apr 4, 2026
@xuchenma

xuchenma commented Jun 4, 2026

Copy link
Copy Markdown
Contributor Author

Closing as obsolete. The underlying failure (hashicorp/terraform-provider-google#22528) was fixed by the merged #14003, and the apigee_organization_cloud_basic_data_residency_test.tf.tmpl template in main already has the corrected wait_after_destroy ordering. This PR is no longer needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

awaiting-approval Pull requests that need reviewer's approval to run presubmit tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Failing test(s): TestAccApigeeOrganization_apigeeOrganizationCloudBasicDataResidencyTestExample

2 participants