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

Commits on Oct 7, 2020

  1. resource/aws_emr_instance_fleet: Prevent error on deletion when EMR C…

    …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 committed Oct 7, 2020
    Configuration menu
    Copy the full SHA
    5048c0d View commit details
    Browse the repository at this point in the history