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_s3_bucket_analytics_configuration: Check resource.TimeoutError on deletion #15529

Merged
merged 1 commit into from
Oct 7, 2020

Conversation

bflad
Copy link
Contributor

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

Reference: #12985

Release note for CHANGELOG:

* resource/aws_s3_bucket_analytics_configuration: Prevent unexpected timeout error on deletion due to API throttling

Output from acceptance testing (test failure present on main branch):

--- FAIL: TestAccAWSS3BucketAnalyticsConfiguration_WithStorageClassAnalysis_Empty (2.96s)
--- PASS: TestAccAWSS3BucketAnalyticsConfiguration_WithFilter_Empty (3.02s)
--- PASS: TestAccAWSS3BucketAnalyticsConfiguration_basic (36.11s)
--- PASS: TestAccAWSS3BucketAnalyticsConfiguration_WithStorageClassAnalysis_Full (38.05s)
--- PASS: TestAccAWSS3BucketAnalyticsConfiguration_WithStorageClassAnalysis_Default (39.12s)
--- PASS: TestAccAWSS3BucketAnalyticsConfiguration_removed (58.44s)
--- PASS: TestAccAWSS3BucketAnalyticsConfiguration_WithFilter_SingleTag (61.76s)
--- PASS: TestAccAWSS3BucketAnalyticsConfiguration_WithFilter_Remove (62.27s)
--- PASS: TestAccAWSS3BucketAnalyticsConfiguration_WithFilter_PrefixAndTags (64.30s)
--- PASS: TestAccAWSS3BucketAnalyticsConfiguration_WithFilter_MultipleTags (64.43s)
--- PASS: TestAccAWSS3BucketAnalyticsConfiguration_WithFilter_Prefix (64.54s)
--- PASS: TestAccAWSS3BucketAnalyticsConfiguration_updateBasic (102.92s)

…tError on deletion

Reference: #12985

Output from acceptance testing (test failure present on main branch):

```
--- FAIL: TestAccAWSS3BucketAnalyticsConfiguration_WithStorageClassAnalysis_Empty (2.96s)
--- PASS: TestAccAWSS3BucketAnalyticsConfiguration_WithFilter_Empty (3.02s)
--- PASS: TestAccAWSS3BucketAnalyticsConfiguration_basic (36.11s)
--- PASS: TestAccAWSS3BucketAnalyticsConfiguration_WithStorageClassAnalysis_Full (38.05s)
--- PASS: TestAccAWSS3BucketAnalyticsConfiguration_WithStorageClassAnalysis_Default (39.12s)
--- PASS: TestAccAWSS3BucketAnalyticsConfiguration_removed (58.44s)
--- PASS: TestAccAWSS3BucketAnalyticsConfiguration_WithFilter_SingleTag (61.76s)
--- PASS: TestAccAWSS3BucketAnalyticsConfiguration_WithFilter_Remove (62.27s)
--- PASS: TestAccAWSS3BucketAnalyticsConfiguration_WithFilter_PrefixAndTags (64.30s)
--- PASS: TestAccAWSS3BucketAnalyticsConfiguration_WithFilter_MultipleTags (64.43s)
--- PASS: TestAccAWSS3BucketAnalyticsConfiguration_WithFilter_Prefix (64.54s)
--- PASS: TestAccAWSS3BucketAnalyticsConfiguration_updateBasic (102.92s)
```
@bflad bflad added bug Addresses a defect in current functionality. technical-debt Addresses areas of the codebase that need refactoring or redesign. labels Oct 6, 2020
@bflad bflad requested a review from a team October 6, 2020 19:26
@ghost ghost added size/XS Managed by automation to categorize the size of a PR. service/s3 Issues and PRs that pertain to the s3 service. labels Oct 6, 2020
@YakDriver YakDriver self-assigned this Oct 7, 2020
Copy link
Member

@YakDriver YakDriver left a comment

Choose a reason for hiding this comment

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

Would it be possible and/or worthwhile to add an acceptance test that consistently fails without the fix?

@bflad
Copy link
Contributor Author

bflad commented Oct 7, 2020

@YakDriver I'm not sure how to ensure the API or network layer always throttles requests past the timeout for that type of test beyond generating a ton of concurrent test resources. Sometimes this throttling occurs when the service team is trying to fix backend issues or the Terraform executor is having trouble opening network sockets in highly concurrent runs, which is not reproducible without mocking the API and/or network stack which we have long avoided due to the complexity and maintainability that framework would require over time. It was decided awhile ago that the most pragmatic approach to these would be to fix the issue from a code perspective, document the behavior in the Contributing Guide, and for maintainers to be on the lookout for it. Now we can have linters doing the hard work.

Copy link
Member

@YakDriver YakDriver 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: TestFlattenS3StorageClassAnalysis (0.06s)
--- PASS: TestFlattenS3AnalyticsFilter (0.49s)
--- PASS: TestExpandS3AnalyticsFilter (0.54s)
--- PASS: TestExpandS3StorageClassAnalysis (0.63s)
--- PASS: TestAccAWSS3BucketAnalyticsConfiguration_WithFilter_Empty (5.57s)
--- FAIL: TestAccAWSS3BucketAnalyticsConfiguration_WithStorageClassAnalysis_Empty (6.07s)
--- PASS: TestAccAWSS3BucketAnalyticsConfiguration_WithStorageClassAnalysis_Default (42.24s)
--- PASS: TestAccAWSS3BucketAnalyticsConfiguration_basic (44.71s)
--- PASS: TestAccAWSS3BucketAnalyticsConfiguration_WithStorageClassAnalysis_Full (45.15s)
--- PASS: TestAccAWSS3BucketAnalyticsConfiguration_removed (65.34s)
--- PASS: TestAccAWSS3BucketAnalyticsConfiguration_WithFilter_PrefixAndTags (67.00s)
--- PASS: TestAccAWSS3BucketAnalyticsConfiguration_WithFilter_Prefix (67.58s)
--- PASS: TestAccAWSS3BucketAnalyticsConfiguration_WithFilter_MultipleTags (67.76s)
--- PASS: TestAccAWSS3BucketAnalyticsConfiguration_WithFilter_Remove (68.06s)
--- PASS: TestAccAWSS3BucketAnalyticsConfiguration_WithFilter_SingleTag (70.15s)
--- PASS: TestAccAWSS3BucketAnalyticsConfiguration_updateBasic (82.68s)

Failure appears transient and unrelated:

TestAccAWSS3BucketAnalyticsConfiguration_WithStorageClassAnalysis_Empty: resource_aws_s3_bucket_analytics_configuration_test.go:361: Step 1/1, expected an error with pattern, no match on: Error running pre-apply refresh: 2020/10/07 14:45:47 [DEBUG] Using modified User-Agent: Terraform/0.12.29 HashiCorp-terraform-exec/0.10.0
        
        Error: Required attribute is not set
        
          on config359220260/terraform_plugin_test.tf line 6, in resource "aws_s3_bucket_analytics_configuration" "test":
           6:   storage_class_analysis {   
--- FAIL: TestAccAWSS3BucketAnalyticsConfiguration_WithStorageClassAnalysis_Empty (5.89s)

@bflad bflad added this to the v3.10.0 milestone Oct 7, 2020
@bflad bflad merged commit 4b79c47 into master Oct 7, 2020
@bflad bflad deleted the b-aws_s3_bucket_analytics_configuration-TimeoutError branch October 7, 2020 19:12
bflad added a commit that referenced this pull request Oct 7, 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 7, 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 7, 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/s3 Issues and PRs that pertain to the s3 service. size/XS Managed by automation to categorize the size of a PR. technical-debt Addresses areas of the codebase that need refactoring or redesign.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants