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

b/aws_redshift_cluster: Adds retries to enabling and disabling the redshift cluster's logging #22080

Merged

Conversation

larssnellman
Copy link
Contributor

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

Adds retries to actions that enable or disable the redshift cluster's logging when returned the error code "InvalidClusterState".

Closes #21815

Output from acceptance testing:

TF_ACC=1 go test ./internal/service/redshift -v -count 1 -parallel 20 -run=TestAccRedshiftCluster_loggingEnabled -timeout 180m
=== RUN   TestAccRedshiftCluster_loggingEnabled
=== PAUSE TestAccRedshiftCluster_loggingEnabled
=== CONT  TestAccRedshiftCluster_loggingEnabled
--- PASS: TestAccRedshiftCluster_loggingEnabled (311.60s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/redshift	314.640s
...

Previously:
(Test would intermittently fail, in this example we fail on removing logging)

lars@Lars's-MacBook-Pro terraform-provider-aws % TF_ACC=1 go test ./internal/service/redshift -v -count 1 -parallel 20 -run=TestAccRedshiftCluster_loggingEnabled -timeout 180m
=== RUN   TestAccRedshiftCluster_loggingEnabled
=== PAUSE TestAccRedshiftCluster_loggingEnabled
=== CONT  TestAccRedshiftCluster_loggingEnabled
--- PASS: TestAccRedshiftCluster_loggingEnabled (260.11s)
PASS
ok      github.com/hashicorp/terraform-provider-aws/internal/service/redshift   262.972s
lars@Lars's-MacBook-Pro terraform-provider-aws % TF_ACC=1 go test ./internal/service/redshift -v -count 1 -parallel 20 -run=TestAccRedshiftCluster_loggingEnabled -timeout 180m
=== RUN   TestAccRedshiftCluster_loggingEnabled
=== PAUSE TestAccRedshiftCluster_loggingEnabled
=== CONT  TestAccRedshiftCluster_loggingEnabled
    cluster_test.go:191: Step 3/3 error: Error running apply: exit status 1

        Error: InvalidClusterState: There is an operation running on the Cluster. Please try to disable logging at a later time.
                status code: 400, request id: a30468db-ea8e-4b9e-b92f-f338ca5db0fd

          with aws_redshift_cluster.test,
          on terraform_plugin_test.tf line 12, in resource "aws_redshift_cluster" "test":
          12: resource "aws_redshift_cluster" "test" {

--- FAIL: TestAccRedshiftCluster_loggingEnabled (279.75s)
FAIL
FAIL    github.com/hashicorp/terraform-provider-aws/internal/service/redshift   282.620s
FAIL

@github-actions github-actions bot added needs-triage Waiting for first response or review from a maintainer. service/redshift Issues and PRs that pertain to the redshift service. size/XS Managed by automation to categorize the size of a PR. labels Dec 7, 2021
@larssnellman larssnellman changed the title [WIP] b/aws_redshift_cluster: Adds retries to enabling and disabling the redshift cluster's logging b/aws_redshift_cluster: Adds retries to enabling and disabling the redshift cluster's logging Dec 7, 2021
@ewbankkit ewbankkit removed the needs-triage Waiting for first response or review from a maintainer. label Dec 7, 2021
@ewbankkit
Copy link
Contributor

We have a failing CI test:

=== RUN   TestAccRedshiftCluster_loggingEnabled
=== PAUSE TestAccRedshiftCluster_loggingEnabled
=== CONT  TestAccRedshiftCluster_loggingEnabled
cluster_test.go:191: Step 3/3 error: Error running apply: exit status 1
Error: InvalidClusterState: There is an operation running on the Cluster. Please try to disable logging at a later time.
  status code: 400, request id: 2aaa7058-dc20-4da5-8953-7d2fa4ebeaed
with aws_redshift_cluster.test,
on terraform_plugin_test.tf line 12, in resource "aws_redshift_cluster" "test":
12: resource "aws_redshift_cluster" "test" {

…constant when retrying enable/disable logging.
@github-actions github-actions bot added size/S Managed by automation to categorize the size of a PR. and removed size/XS Managed by automation to categorize the size of a PR. labels Dec 7, 2021
Copy link
Contributor

@ewbankkit ewbankkit left a comment

Choose a reason for hiding this comment

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

LGTM 🚀.

% make testacc PKG=redshift TESTS=TestAccRedshiftCluster_loggingEnabled                                                    
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/redshift/... -v -count 1 -parallel 20 -run='TestAccRedshiftCluster_loggingEnabled' -timeout 180m
=== RUN   TestAccRedshiftCluster_loggingEnabled
=== PAUSE TestAccRedshiftCluster_loggingEnabled
=== CONT  TestAccRedshiftCluster_loggingEnabled
--- PASS: TestAccRedshiftCluster_loggingEnabled (297.52s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/redshift	301.171s

@ewbankkit
Copy link
Contributor

@larssnellman Thanks for the contribution 🎉 👏.

@ewbankkit ewbankkit merged commit 39568e2 into hashicorp:main Dec 7, 2021
@github-actions github-actions bot added this to the v3.69.0 milestone Dec 7, 2021
@github-actions
Copy link

This functionality has been released in v3.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. Thank you!

@github-actions
Copy link

github-actions bot commented Jun 3, 2022

I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 3, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
service/redshift Issues and PRs that pertain to the redshift service. size/S Managed by automation to categorize the size of a PR.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Redshift Cluster not fully setup when logging enabled
2 participants