GoogleCloudPlatform / terraform-google-cloud-functions

Deploys Cloud Functions (Gen 2)
https://registry.terraform.io/modules/GoogleCloudPlatform/cloud-functions/google
Apache License 2.0
30 stars 25 forks source link

chore: add retry to secure cloud function test #112

Closed daniel-cit closed 3 months ago

daniel-cit commented 3 months ago

This PR adds a retry strategy for some retryable errors in the tests for the secure cloud function exemples

daniel-cit commented 3 months ago

@apeabody It worked :)

Step #11 - "secure-cloud-func-internal-server-teardown": TestCFInternalServer 2024-04-05T22:49:27Z command.go:185: Plan: 0 to add, 0 to change, 141 to destroy.
Step #11 - "secure-cloud-func-internal-server-teardown": Error: googleapi: Error 403: Request is prohibited by organization's policy. vpcServiceControlsUniqueIdentifier: K8gSwR1OJw1_EqX1Z8d10ksVLsy45sNG6DHXCY0hP7xhZaiEeDlwgg
Step #11 - "secure-cloud-func-internal-server-teardown": Details:
Step #11 - "secure-cloud-func-internal-server-teardown": [
Step #11 - "secure-cloud-func-internal-server-teardown":   {
Step #11 - "secure-cloud-func-internal-server-teardown":     "@type": "type.googleapis.com/google.rpc.PreconditionFailure",
Step #11 - "secure-cloud-func-internal-server-teardown":     "violations": [
Step #11 - "secure-cloud-func-internal-server-teardown":       {
Step #11 - "secure-cloud-func-internal-server-teardown":         "description": "K8gSwR1OJw1_EqX1Z8d10ksVLsy45sNG6DHXCY0hP7xhZaiEeDlwgg",
Step #11 - "secure-cloud-func-internal-server-teardown":         "type": "VPC_SERVICE_CONTROLS"
Step #11 - "secure-cloud-func-internal-server-teardown":       }
Step #11 - "secure-cloud-func-internal-server-teardown":     ]
Step #11 - "secure-cloud-func-internal-server-teardown":   },
Step #11 - "secure-cloud-func-internal-server-teardown":   {
Step #11 - "secure-cloud-func-internal-server-teardown":     "@type": "type.googleapis.com/google.rpc.ErrorInfo",
Step #11 - "secure-cloud-func-internal-server-teardown":     "domain": "googleapis.com",
Step #11 - "secure-cloud-func-internal-server-teardown":     "metadata": {
Step #11 - "secure-cloud-func-internal-server-teardown":       "consumer": "projects/REDACTED",
Step #11 - "secure-cloud-func-internal-server-teardown":       "service": "iam.googleapis.com",
Step #11 - "secure-cloud-func-internal-server-teardown":       "uid": "K8gSwR1OJw1_EqX1Z8d10ksVLsy45sNG6DHXCY0hP7xhZaiEeDlwgg"
Step #11 - "secure-cloud-func-internal-server-teardown":     },
Step #11 - "secure-cloud-func-internal-server-teardown":     "reason": "SECURITY_POLICY_VIOLATED"
Step #11 - "secure-cloud-func-internal-server-teardown":   }
Step #11 - "secure-cloud-func-internal-server-teardown": ]
Step #11 - "secure-cloud-func-internal-server-teardown": , forbidden
Step #11 - "secure-cloud-func-internal-server-teardown": . Sleeping for 1m0s and will try again.
Step #11 - "secure-cloud-func-internal-server-teardown": TestCFInternalServer 2024-04-05T23:05:29Z command.go:185: Plan: 0 to add, 0 to change, 21 to destroy.
Step #11 - "secure-cloud-func-internal-server-teardown": TestCFInternalServer 2024-04-05T23:05:37Z command.go:185: random_id.random_folder_suffix: Destruction complete after 0s
Step #11 - "secure-cloud-func-internal-server-teardown": TestCFInternalServer 2024-04-05T23:05:37Z command.go:185: 
Step #11 - "secure-cloud-func-internal-server-teardown": TestCFInternalServer 2024-04-05T23:05:37Z command.go:185: Destroy complete! Resources: 21 destroyed.
Step #11 - "secure-cloud-func-internal-server-teardown": --- PASS: TestCFInternalServer (1071.79s)
Step #11 - "secure-cloud-func-internal-server-teardown": PASS
Step #11 - "secure-cloud-func-internal-server-teardown": ok     github.com/terraform-google-modules/cloud-functions/test/integration/secure_cloud_function_internal_server  1071.801s
Finished Step #11 - "secure-cloud-func-internal-server-teardown"