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_emr_instance_fleet: Prevent error on deletion when EMR Cluster is no longer running #15548

Merged
merged 1 commit into from
Oct 8, 2020

Conversation

bflad
Copy link
Contributor

@bflad bflad commented Oct 7, 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

Release note for CHANGELOG:

* resource/aws_emr_instance_fleet: Prevent error on deletion when EMR Cluster is no longer running

The Terraform Plugin SDK v2.0.4 upgrade fixed some ExpectNonEmptyPlan testing behaviors and began showing TestAccAWSEMRInstanceFleet_disappears test failures that should have been occurring all along. EMR Instance Fleets cannot be deleted themselves, so switched this to verify EMR Cluster deletion handling which highlighted this bug on deletion.

Previously:

=== CONT  TestAccAWSEMRInstanceFleet_disappears
TestAccAWSEMRInstanceFleet_disappears: resource_aws_emr_instance_fleet_test.go:136: Step 1/1 error: Expected a non-empty plan, but got an empty plan!
--- FAIL: TestAccAWSEMRInstanceFleet_disappears (478.30s)

After adjusting the test to delete the EMR Cluster:

=== CONT  TestAccAWSEMRInstanceFleet_disappears
    testing_new.go:62: Error running post-test destroy, there may be dangling resources: 2020/10/07 14:25:31 [DEBUG] Using modified User-Agent: Terraform/0.12.29 HashiCorp-terraform-exec/0.10.0

        Error: error deleting/modifying EMR Instance Fleet (if-9F0XM3B3BVPS): InvalidRequestException: An instance fleet may only be modified when the cluster is running or waiting.
        {
          RespMetadata: {
            StatusCode: 400,
            RequestID: "d0ac3071-8f85-45a2-a938-1cba69d4ca1d"
          },
          ErrorCode: "MODIFY_INSTANCE_FLEET_OF_RUNNING_JOBFLOW_ONLY",
          Message_: "An instance fleet may only be modified when the cluster is running or waiting."
        }

--- FAIL: TestAccAWSEMRInstanceFleet_disappears (411.82s)

Output from acceptance testing:

--- PASS: TestAccAWSEMRInstanceFleet_disappears (493.55s)

…luster is no longer running

The Terraform Plugin SDK v2.0.4 upgrade fixed some `ExpectNonEmptyPlan` testing behaviors and began showing `TestAccAWSEMRInstanceFleet_disappears` test failures that should have been occurring all along. EMR Instance Fleets cannot be deleted themselves, so switched this to verify EMR Cluster deletion handling which highlighted this bug on deletion.

Previously:

```
=== CONT  TestAccAWSEMRInstanceFleet_disappears
TestAccAWSEMRInstanceFleet_disappears: resource_aws_emr_instance_fleet_test.go:136: Step 1/1 error: Expected a non-empty plan, but got an empty plan!
--- FAIL: TestAccAWSEMRInstanceFleet_disappears (478.30s)
```

After adjusting the test to delete the EMR Cluster:

```
=== CONT  TestAccAWSEMRInstanceFleet_disappears
    testing_new.go:62: Error running post-test destroy, there may be dangling resources: 2020/10/07 14:25:31 [DEBUG] Using modified User-Agent: Terraform/0.12.29 HashiCorp-terraform-exec/0.10.0

        Error: error deleting/modifying EMR Instance Fleet (if-9F0XM3B3BVPS): InvalidRequestException: An instance fleet may only be modified when the cluster is running or waiting.
        {
          RespMetadata: {
            StatusCode: 400,
            RequestID: "d0ac3071-8f85-45a2-a938-1cba69d4ca1d"
          },
          ErrorCode: "MODIFY_INSTANCE_FLEET_OF_RUNNING_JOBFLOW_ONLY",
          Message_: "An instance fleet may only be modified when the cluster is running or waiting."
        }

--- FAIL: TestAccAWSEMRInstanceFleet_disappears (411.82s)
```

Output from acceptance testing:

```
--- PASS: TestAccAWSEMRInstanceFleet_disappears (493.55s)
```
@bflad bflad added the bug Addresses a defect in current functionality. label Oct 7, 2020
@bflad bflad requested a review from a team October 7, 2020 18:43
@ghost ghost added size/XS Managed by automation to categorize the size of a PR. service/emr Issues and PRs that pertain to the emr service. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure. labels Oct 7, 2020
@gdavison gdavison self-assigned this Oct 7, 2020
Copy link
Contributor

@gdavison gdavison left a comment

Choose a reason for hiding this comment

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

LGTM 🚀

--- PASS: TestAccAWSEMRInstanceFleet_ebsBasic (468.68s)
--- PASS: TestAccAWSEMRInstanceFleet_basic (477.81s)
--- PASS: TestAccAWSEMRInstanceFleet_disappears (492.51s)
--- PASS: TestAccAWSEMRInstanceFleet_full (536.22s)
--- PASS: TestAccAWSEMRInstanceFleet_zero_count (581.77s)

@gdavison gdavison merged commit b3016f2 into master Oct 8, 2020
@gdavison gdavison deleted the t-aws_emr_instance_fleet-disappears branch October 8, 2020 17:50
gdavison added a commit that referenced this pull request Oct 8, 2020
@gdavison gdavison added this to the v3.10.0 milestone Oct 8, 2020
@ghost
Copy link

ghost commented Oct 9, 2020

This has been released in version 3.10.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 Nov 8, 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 as resolved and limited conversation to collaborators Nov 8, 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/emr Issues and PRs that pertain to the emr 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.

2 participants