From d3e835c74ab241c53f48e995c04200cfcffd8d96 Mon Sep 17 00:00:00 2001 From: Brian Flad Date: Wed, 13 Mar 2019 14:24:35 -0400 Subject: [PATCH] test/resource/aws_api_gateway_usage_plan: Prevent intermittent ConflictException errors for concurrent deployments Previously, the test configurations could trigger two deployments at the same time since the ordering was not guaranteed. If we still see issues with this error in the future even with ordering these properly, we can consider allowing retries in the `aws_api_gateway_deployment` resource for this error. Previous output from acceptance testing: ``` --- FAIL: TestAccAWSAPIGatewayUsagePlan_basic (738.05s) testing.go:568: Step 0 error: errors during apply: Error: Error creating API Gateway Deployment: ConflictException: Another Deployment is in progress for rest api with id dy728fw3i3 . Please try again later. --- FAIL: TestAccAWSAPIGatewayUsagePlan_productCode (59.28s) testing.go:568: Step 0 error: errors during apply: Error: Error creating API Gateway Deployment: ConflictException: Another Deployment is in progress for rest api with id uf0qt1c7da . Please try again later. --- FAIL: TestAccAWSAPIGatewayUsagePlan_throttling (439.70s) testing.go:568: Step 0 error: errors during apply: Error: Error creating API Gateway Deployment: ConflictException: Another Deployment is in progress for rest api with id nu0670a339 . Please try again later. --- FAIL: TestAccAWSAPIGatewayUsagePlan_apiStages (27.48s) testing.go:568: Step 0 error: errors during apply: Error: Error creating API Gateway Deployment: ConflictException: Another Deployment is in progress for rest api with id edoilchkxb . Please try again later. --- FAIL: TestAccAWSAPIGatewayUsagePlan_importBasic (122.32s) testing.go:568: Step 0 error: errors during apply: Error: Error creating API Gateway Deployment: ConflictException: Another Deployment is in progress for rest api with id 4t4s36a8a3 . Please try again later. --- FAIL: TestAccAWSAPIGatewayUsagePlan_quota (375.79s) testing.go:568: Step 0 error: errors during apply: Error: Error creating API Gateway Deployment: ConflictException: Another Deployment is in progress for rest api with id 1snamo3rpa . Please try again later. --- FAIL: TestAccAWSAPIGatewayUsagePlan_throttlingInitialRateLimit (905.32s) testing.go:568: Step 0 error: errors during apply: Error: Error creating API Gateway Deployment: ConflictException: Another Deployment is in progress for rest api with id xlnb4foagg . Please try again later. ``` Output from acceptance testing: ``` --- PASS: TestAccAWSAPIGatewayUsagePlan_throttlingInitialRateLimit (68.05s) --- PASS: TestAccAWSAPIGatewayUsagePlan_apiStages (99.87s) --- PASS: TestAccAWSAPIGatewayUsagePlan_importBasic (129.23s) --- PASS: TestAccAWSAPIGatewayUsagePlan_basic (199.02s) --- PASS: TestAccAWSAPIGatewayUsagePlan_throttling (235.79s) --- PASS: TestAccAWSAPIGatewayUsagePlan_quota (262.42s) --- PASS: TestAccAWSAPIGatewayUsagePlan_description (301.14s) --- PASS: TestAccAWSAPIGatewayUsagePlan_productCode (345.68s) ``` --- aws/resource_aws_api_gateway_usage_plan_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/aws/resource_aws_api_gateway_usage_plan_test.go b/aws/resource_aws_api_gateway_usage_plan_test.go index 91f851a7123..04f31749eda 100644 --- a/aws/resource_aws_api_gateway_usage_plan_test.go +++ b/aws/resource_aws_api_gateway_usage_plan_test.go @@ -459,7 +459,7 @@ resource "aws_api_gateway_deployment" "test" { } resource "aws_api_gateway_deployment" "foo" { - depends_on = ["aws_api_gateway_integration.test"] + depends_on = ["aws_api_gateway_deployment.test", "aws_api_gateway_integration.test"] rest_api_id = "${aws_api_gateway_rest_api.test.id}" stage_name = "foo"