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 acceptance tests errors on "delete" #13065

Closed
anGie44 opened this issue Apr 28, 2020 · 2 comments · Fixed by #13922
Closed

resource_aws_spot_fleet_request acceptance tests errors on "delete" #13065

anGie44 opened this issue Apr 28, 2020 · 2 comments · Fixed by #13922
Assignees
Labels
bug Addresses a defect in current functionality. service/ec2 Issues and PRs that pertain to the ec2 service. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure.
Milestone

Comments

@anGie44
Copy link
Contributor

anGie44 commented Apr 28, 2020

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue 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 issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Terraform Version

  • 0.12

Affected Resource(s)

  • aws_spot_fleet_request acceptance tests

Expected Behavior

  • acceptance tests should pass without throwing errors such as:
Error: error deleting spot request (sfr-****): error reading Spot Fleet Instances (sfr-****): fleet still has (1) running instances

Actual Behavior

  • test failures can vary but include:
FAIL: TestAccAWSSpotFleetRequest_overriddingSpotPrice
FAIL: TestAccAWSSpotFleetRequest_withoutSpotPrice
FAIL: TestAccAWSSpotFleetRequest_diversifiedAllocation
FAIL: TestAccAWSSpotFleetRequest_multipleInstancePools
FAIL: TestAccAWSSpotFleetRequest_updateExcessCapacityTerminationPolicy
FAIL: TestAccAWSSpotFleetRequest_tags
FAIL: TestAccAWSSpotFleetRequest_launchTemplateToLaunchSpec

Steps to Reproduce

  1. make testacc TEST=./aws TESTARGS='-run=TestAccAWSSpotFleetRequest_

Important Factoids

  • The resource's Delete default timeout set to 5 minutes

References

@ghost ghost added the service/ec2 Issues and PRs that pertain to the ec2 service. label Apr 28, 2020
@github-actions github-actions bot added the needs-triage Waiting for first response or review from a maintainer. label Apr 28, 2020
@bflad bflad added bug Addresses a defect in current functionality. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure. and removed needs-triage Waiting for first response or review from a maintainer. labels Jun 24, 2020
@bflad bflad self-assigned this Jun 24, 2020
bflad added a commit that referenced this issue Jun 24, 2020
…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 this to the v2.69.0 milestone Jul 1, 2020
bflad added a commit that referenced this issue Jul 1, 2020
…5 minutes (#13922)

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)
```
@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. service/ec2 Issues and PRs that pertain to the ec2 service. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure.
Projects
None yet
2 participants