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

resource/aws_spot_fleet_request: Increase default delete timeout to 15 minutes #13922

Merged
merged 1 commit into from
Jul 1, 2020

Conversation

bflad
Copy link
Contributor

@bflad bflad commented Jun 24, 2020

Community Note

  • Please vote on this pull request by adding a 👍 reaction to the original pull request comment to help the community and maintainers prioritize this request
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for pull request followers and do not help prioritize the request

Closes #13065
Reference: #13527

Release note for CHANGELOG:

* resource/aws_spot_fleet_request: Increase default delete timeout to 15 minutes

The EC2 documentation does not provide too much guidance on how long EC2 Instance termination should take ("a few minutes"), however in practice we have seen many errors at 5 minutes on instances with no actual workload. While watching the request logs and viewing the EC2 console, it appears there may also be eventual consistency between instance termination and when the DescribeSpotFleetInstances API response has active instances removed.

This changeset also provides minor testing improvements such as using resource.ParallelTest() for tests missing it and switching the disappears testing to use the shared testAccCheckResourceDisappears() function.

Output from acceptance testing:

--- PASS: TestAccAWSSpotFleetRequest_associatePublicIpAddress (319.23s)
--- PASS: TestAccAWSSpotFleetRequest_basic (298.32s)
--- PASS: TestAccAWSSpotFleetRequest_changePriceForcesNewRequest (649.15s)
--- PASS: TestAccAWSSpotFleetRequest_disappears (454.76s)
--- PASS: TestAccAWSSpotFleetRequest_diversifiedAllocation (354.21s)
--- PASS: TestAccAWSSpotFleetRequest_fleetType (298.39s)
--- PASS: TestAccAWSSpotFleetRequest_iamInstanceProfileArn (434.74s)
--- PASS: TestAccAWSSpotFleetRequest_instanceInterruptionBehavior (474.48s)
--- PASS: TestAccAWSSpotFleetRequest_LaunchSpecification_EbsBlockDevice_KmsKeyId (161.36s)
--- PASS: TestAccAWSSpotFleetRequest_LaunchSpecification_RootBlockDevice_KmsKeyId (168.88s)
--- PASS: TestAccAWSSpotFleetRequest_launchSpecToLaunchTemplate (500.29s)
--- PASS: TestAccAWSSpotFleetRequest_launchTemplate (236.95s)
--- PASS: TestAccAWSSpotFleetRequest_launchTemplate_multiple (241.01s)
--- PASS: TestAccAWSSpotFleetRequest_launchTemplateToLaunchSpec (536.94s)
--- PASS: TestAccAWSSpotFleetRequest_launchTemplateWithOverrides (235.98s)
--- PASS: TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList (248.40s)
--- PASS: TestAccAWSSpotFleetRequest_lowestPriceAzOrSubnetInRegion (301.21s)
--- PASS: TestAccAWSSpotFleetRequest_lowestPriceSubnetInGivenList (250.00s)
--- PASS: TestAccAWSSpotFleetRequest_multipleInstancePools (343.81s)
--- PASS: TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameAz (311.80s)
--- PASS: TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameSubnet (288.35s)
--- PASS: TestAccAWSSpotFleetRequest_overriddingSpotPrice (319.60s)
--- PASS: TestAccAWSSpotFleetRequest_placementTenancyAndGroup (72.49s)
--- PASS: TestAccAWSSpotFleetRequest_tags (340.04s)
--- PASS: TestAccAWSSpotFleetRequest_updateExcessCapacityTerminationPolicy (643.56s)
--- PASS: TestAccAWSSpotFleetRequest_updateTargetCapacity (929.39s)
--- PASS: TestAccAWSSpotFleetRequest_withEBSDisk (329.00s)
--- PASS: TestAccAWSSpotFleetRequest_WithELBs (266.68s)
--- PASS: TestAccAWSSpotFleetRequest_withoutSpotPrice (287.66s)
--- PASS: TestAccAWSSpotFleetRequest_withTags (299.45s)
--- PASS: TestAccAWSSpotFleetRequest_WithTargetGroups (483.65s)
--- PASS: TestAccAWSSpotFleetRequest_withWeightedCapacity (347.27s)

…5 minutes

Reference: #13065
Reference: #13527

The EC2 documentation does not provide too much guidance on how long EC2 Instance termination should take ("a few minutes"), however in practice we have seen many errors at 5 minutes on instances with no actual workload. While watching the request logs and viewing the EC2 console, it appears there may also be eventual consistency between instance termination and when the `DescribeSpotFleetInstances` API response has active instances removed.

This changeset also provides minor testing improvements such as using `resource.ParallelTest()` for tests missing it and switching the disappears testing to use the shared `testAccCheckResourceDisappears()` function.

Output from acceptance testing:

```
--- PASS: TestAccAWSSpotFleetRequest_associatePublicIpAddress (319.23s)
--- PASS: TestAccAWSSpotFleetRequest_basic (298.32s)
--- PASS: TestAccAWSSpotFleetRequest_changePriceForcesNewRequest (649.15s)
--- PASS: TestAccAWSSpotFleetRequest_disappears (454.76s)
--- PASS: TestAccAWSSpotFleetRequest_diversifiedAllocation (354.21s)
--- PASS: TestAccAWSSpotFleetRequest_fleetType (298.39s)
--- PASS: TestAccAWSSpotFleetRequest_iamInstanceProfileArn (434.74s)
--- PASS: TestAccAWSSpotFleetRequest_instanceInterruptionBehavior (474.48s)
--- PASS: TestAccAWSSpotFleetRequest_LaunchSpecification_EbsBlockDevice_KmsKeyId (161.36s)
--- PASS: TestAccAWSSpotFleetRequest_LaunchSpecification_RootBlockDevice_KmsKeyId (168.88s)
--- PASS: TestAccAWSSpotFleetRequest_launchSpecToLaunchTemplate (500.29s)
--- PASS: TestAccAWSSpotFleetRequest_launchTemplate (236.95s)
--- PASS: TestAccAWSSpotFleetRequest_launchTemplate_multiple (241.01s)
--- PASS: TestAccAWSSpotFleetRequest_launchTemplateToLaunchSpec (536.94s)
--- PASS: TestAccAWSSpotFleetRequest_launchTemplateWithOverrides (235.98s)
--- PASS: TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList (248.40s)
--- PASS: TestAccAWSSpotFleetRequest_lowestPriceAzOrSubnetInRegion (301.21s)
--- PASS: TestAccAWSSpotFleetRequest_lowestPriceSubnetInGivenList (250.00s)
--- PASS: TestAccAWSSpotFleetRequest_multipleInstancePools (343.81s)
--- PASS: TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameAz (311.80s)
--- PASS: TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameSubnet (288.35s)
--- PASS: TestAccAWSSpotFleetRequest_overriddingSpotPrice (319.60s)
--- PASS: TestAccAWSSpotFleetRequest_placementTenancyAndGroup (72.49s)
--- PASS: TestAccAWSSpotFleetRequest_tags (340.04s)
--- PASS: TestAccAWSSpotFleetRequest_updateExcessCapacityTerminationPolicy (643.56s)
--- PASS: TestAccAWSSpotFleetRequest_updateTargetCapacity (929.39s)
--- PASS: TestAccAWSSpotFleetRequest_withEBSDisk (329.00s)
--- PASS: TestAccAWSSpotFleetRequest_WithELBs (266.68s)
--- PASS: TestAccAWSSpotFleetRequest_withoutSpotPrice (287.66s)
--- PASS: TestAccAWSSpotFleetRequest_withTags (299.45s)
--- PASS: TestAccAWSSpotFleetRequest_WithTargetGroups (483.65s)
--- PASS: TestAccAWSSpotFleetRequest_withWeightedCapacity (347.27s)
```
@bflad bflad added the bug Addresses a defect in current functionality. label Jun 24, 2020
@bflad bflad requested a review from a team June 24, 2020 15:40
@ghost ghost added size/XS Managed by automation to categorize the size of a PR. documentation Introduces or discusses updates to documentation. service/ec2 Issues and PRs that pertain to the ec2 service. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure. labels Jun 24, 2020
Copy link
Contributor

@anGie44 anGie44 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great!

Output of acceptance tests:

--- PASS: TestAccAWSSpotFleetRequest_associatePublicIpAddress (244.72s)
--- PASS: TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameAz (257.57s)
--- PASS: TestAccAWSSpotFleetRequest_overriddingSpotPrice (258.18s)
--- PASS: TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameSubnet (259.31s)
--- PASS: TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList (261.91s)
--- PASS: TestAccAWSSpotFleetRequest_lowestPriceSubnetInGivenList (262.30s)
--- PASS: TestAccAWSSpotFleetRequest_iamInstanceProfileArn (283.70s)
--- PASS: TestAccAWSSpotFleetRequest_instanceInterruptionBehavior (285.95s)
--- PASS: TestAccAWSSpotFleetRequest_basic (287.32s)
--- PASS: TestAccAWSSpotFleetRequest_launchTemplate_multiple (287.50s)
--- PASS: TestAccAWSSpotFleetRequest_fleetType (289.30s)
--- PASS: TestAccAWSSpotFleetRequest_launchTemplate (289.26s)
--- SKIP: TestAccAWSSpotFleetRequest_WithInstanceStoreAmi (0.00s)
--- PASS: TestAccAWSSpotFleetRequest_lowestPriceAzOrSubnetInRegion (290.37s)
--- PASS: TestAccAWSSpotFleetRequest_launchTemplateWithOverrides (291.66s)
--- PASS: TestAccAWSSpotFleetRequest_tags (292.29s)
--- PASS: TestAccAWSSpotFleetRequest_placementTenancyAndGroup (64.47s)
--- PASS: TestAccAWSSpotFleetRequest_LaunchSpecification_EbsBlockDevice_KmsKeyId (159.06s)
--- PASS: TestAccAWSSpotFleetRequest_LaunchSpecification_RootBlockDevice_KmsKeyId (140.98s)
--- PASS: TestAccAWSSpotFleetRequest_withoutSpotPrice (231.40s)
--- PASS: TestAccAWSSpotFleetRequest_withWeightedCapacity (280.02s)
--- PASS: TestAccAWSSpotFleetRequest_WithELBs (268.61s)
--- PASS: TestAccAWSSpotFleetRequest_withEBSDisk (299.70s)
--- PASS: TestAccAWSSpotFleetRequest_changePriceForcesNewRequest (564.89s)
--- PASS: TestAccAWSSpotFleetRequest_launchSpecToLaunchTemplate (565.65s)
--- PASS: TestAccAWSSpotFleetRequest_launchTemplateToLaunchSpec (567.49s)
--- PASS: TestAccAWSSpotFleetRequest_diversifiedAllocation (362.99s)
--- PASS: TestAccAWSSpotFleetRequest_multipleInstancePools (362.54s)
--- PASS: TestAccAWSSpotFleetRequest_withTags (340.90s)
--- PASS: TestAccAWSSpotFleetRequest_updateExcessCapacityTerminationPolicy (636.44s)
--- PASS: TestAccAWSSpotFleetRequest_WithTargetGroups (410.59s)
--- PASS: TestAccAWSSpotFleetRequest_disappears (412.58s)
--- PASS: TestAccAWSSpotFleetRequest_updateTargetCapacity (982.93s)

@bflad bflad added this to the v2.69.0 milestone Jul 1, 2020
@bflad bflad merged commit 6e90da3 into master Jul 1, 2020
@bflad bflad deleted the b-aws_spot_fleet_request-delete-timeout branch July 1, 2020 11:34
bflad added a commit that referenced this pull request Jul 1, 2020
@ghost
Copy link

ghost commented Jul 3, 2020

This has been released in version 2.69.0 of the Terraform AWS provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading.

For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template for triage. Thanks!

@ghost
Copy link

ghost commented Jul 31, 2020

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thanks!

@ghost ghost locked and limited conversation to collaborators Jul 31, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Addresses a defect in current functionality. documentation Introduces or discusses updates to documentation. service/ec2 Issues and PRs that pertain to the ec2 service. size/XS Managed by automation to categorize the size of a PR. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

resource_aws_spot_fleet_request acceptance tests errors on "delete"
2 participants