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

tests/r/redshift_cluser: Add sweeper concurrency #18576

Merged
merged 3 commits into from
Apr 7, 2021

Conversation

YakDriver
Copy link
Member

@YakDriver YakDriver commented Apr 5, 2021

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

Relates #15334

Output from acceptance testing: N/A

Sweeper testing configuration:

resource "aws_redshift_cluster" "test" {
  cluster_identifier                  = "yakluster"
  availability_zone                   = data.aws_availability_zones.available.names[0]
  database_name                       = "mydb"
  master_username                     = "foo_test"
  master_password                     = "Mustbe8characters"
  node_type                           = "dc1.large"
  automated_snapshot_retention_period = 0
  allow_version_upgrade               = false
  skip_final_snapshot                 = true
}

resource "aws_redshift_cluster" "test2" {
  cluster_identifier                  = "yakluster2"
  availability_zone                   = data.aws_availability_zones.available.names[0]
  database_name                       = "mydb"
  master_username                     = "foo_test"
  master_password                     = "Mustbe8characters"
  node_type                           = "dc1.large"
  automated_snapshot_retention_period = 0
  allow_version_upgrade               = false
  skip_final_snapshot                 = true
}

data "aws_availability_zones" "available" {
  state = "available"

  filter {
    name   = "opt-in-status"
    values = ["opt-in-not-required"]
  }
}

Sweeper test:

% SWEEP=us-west-2 SWEEPARGS=-sweep-run=aws_redshift_cluster make sweep
WARNING: This will destroy infrastructure. Use only in development accounts.
go test ./aws -v -sweep=us-west-2 -sweep-run=aws_redshift_cluster -timeout 60m
2021/04/05 21:37:05 [DEBUG] Running Sweepers for region (us-west-2):
2021/04/05 21:37:05 [DEBUG] Sweeper (aws_redshift_cluster_snapshot) has dependency (aws_redshift_cluster), running..
2021/04/05 21:37:05 [DEBUG] Running Sweeper (aws_redshift_cluster) in region (us-west-2)
2021/04/05 21:37:06 [DEBUG] Destroying Redshift Cluster (yakluster2)
2021/04/05 21:37:06 [DEBUG] Destroying Redshift Cluster (yakluster)
2021/04/05 21:37:06 [DEBUG] Deleting Redshift Cluster: {
  ClusterIdentifier: "yakluster2",
  SkipFinalClusterSnapshot: true
}
2021/04/05 21:37:06 [DEBUG] schema.TimeoutDelete: 40m0s
2021/04/05 21:37:06 [INFO] Deleting Redshift Cluster "yakluster2"
2021/04/05 21:37:06 [DEBUG] Waiting for state to become: [success]
2021/04/05 21:37:06 [DEBUG] Deleting Redshift Cluster: {
  ClusterIdentifier: "yakluster",
  SkipFinalClusterSnapshot: true
}
2021/04/05 21:37:06 [DEBUG] schema.TimeoutDelete: 40m0s
2021/04/05 21:37:06 [INFO] Deleting Redshift Cluster "yakluster"
2021/04/05 21:37:06 [DEBUG] Waiting for state to become: [success]
2021/04/05 21:37:06 [DEBUG] Waiting for state to become: [destroyed]
2021/04/05 21:37:06 [INFO] Reading Redshift Cluster Information: yakluster
2021/04/05 21:37:06 [DEBUG] Waiting for state to become: [destroyed]
2021/04/05 21:37:06 [INFO] Reading Redshift Cluster Information: yakluster2
2021/04/05 21:37:07 [DEBUG] Redshift Cluster status (yakluster): deleting
2021/04/05 21:37:07 [TRACE] Waiting 5s before next try
2021/04/05 21:37:07 [DEBUG] Redshift Cluster status (yakluster2): deleting
2021/04/05 21:37:07 [TRACE] Waiting 5s before next try
2021/04/05 21:37:12 [INFO] Reading Redshift Cluster Information: yakluster
2021/04/05 21:37:12 [INFO] Reading Redshift Cluster Information: yakluster2
2021/04/05 21:37:12 [DEBUG] Redshift Cluster status (yakluster): deleting
2021/04/05 21:37:12 [TRACE] Waiting 10s before next try
2021/04/05 21:37:12 [DEBUG] Redshift Cluster status (yakluster2): deleting
2021/04/05 21:37:12 [TRACE] Waiting 10s before next try
2021/04/05 21:37:22 [INFO] Reading Redshift Cluster Information: yakluster
2021/04/05 21:37:22 [INFO] Reading Redshift Cluster Information: yakluster2
2021/04/05 21:37:23 [DEBUG] Redshift Cluster status (yakluster): deleting
2021/04/05 21:37:23 [TRACE] Waiting 10s before next try
2021/04/05 21:37:23 [DEBUG] Redshift Cluster status (yakluster2): deleting
2021/04/05 21:37:23 [TRACE] Waiting 10s before next try
2021/04/05 21:37:33 [INFO] Reading Redshift Cluster Information: yakluster
2021/04/05 21:37:33 [INFO] Reading Redshift Cluster Information: yakluster2
2021/04/05 21:37:33 [DEBUG] Redshift Cluster status (yakluster): deleting
2021/04/05 21:37:33 [TRACE] Waiting 10s before next try
2021/04/05 21:37:33 [DEBUG] Redshift Cluster status (yakluster2): deleting
2021/04/05 21:37:33 [TRACE] Waiting 10s before next try
2021/04/05 21:37:43 [INFO] Reading Redshift Cluster Information: yakluster
2021/04/05 21:37:43 [INFO] Reading Redshift Cluster Information: yakluster2
2021/04/05 21:37:44 [DEBUG] Redshift Cluster status (yakluster2): deleting
2021/04/05 21:37:44 [TRACE] Waiting 10s before next try
2021/04/05 21:37:44 [DEBUG] Redshift Cluster status (yakluster): deleting
2021/04/05 21:37:44 [TRACE] Waiting 10s before next try
2021/04/05 21:37:54 [INFO] Reading Redshift Cluster Information: yakluster
2021/04/05 21:37:54 [INFO] Reading Redshift Cluster Information: yakluster2
2021/04/05 21:37:54 [DEBUG] Redshift Cluster status (yakluster): deleting
2021/04/05 21:37:54 [TRACE] Waiting 10s before next try
2021/04/05 21:37:54 [DEBUG] Redshift Cluster status (yakluster2): deleting
2021/04/05 21:37:54 [TRACE] Waiting 10s before next try
2021/04/05 21:38:04 [INFO] Reading Redshift Cluster Information: yakluster
2021/04/05 21:38:04 [INFO] Reading Redshift Cluster Information: yakluster2
2021/04/05 21:38:05 [DEBUG] Redshift Cluster status (yakluster): deleting
2021/04/05 21:38:05 [TRACE] Waiting 10s before next try
2021/04/05 21:38:05 [DEBUG] Redshift Cluster status (yakluster2): deleting
2021/04/05 21:38:05 [TRACE] Waiting 10s before next try
2021/04/05 21:38:15 [INFO] Reading Redshift Cluster Information: yakluster
2021/04/05 21:38:15 [INFO] Reading Redshift Cluster Information: yakluster2
2021/04/05 21:38:15 [INFO] Redshift Cluster yakluster2 successfully deleted
2021/04/05 21:38:15 [INFO] Redshift Cluster yakluster successfully deleted
2021/04/05 21:38:15 [DEBUG] Running Sweeper (aws_redshift_cluster_snapshot) in region (us-west-2)
2021/04/05 21:38:15 [DEBUG] No Redshift cluster snapshots to sweep
2021/04/05 21:38:15 [DEBUG] Sweeper (aws_redshift_cluster) already ran in region (us-west-2)
2021/04/05 21:38:15 Sweeper Tests ran successfully:
	- aws_redshift_cluster
	- aws_redshift_cluster_snapshot
ok  	github.com/terraform-providers/terraform-provider-aws/aws	71.867s
% SWEEP=us-west-2 SWEEPARGS=-sweep-run=aws_redshift_cluster make sweep
WARNING: This will destroy infrastructure. Use only in development accounts.
go test ./aws -v -sweep=us-west-2 -sweep-run=aws_redshift_cluster -timeout 60m
2021/04/05 21:38:31 [DEBUG] Running Sweepers for region (us-west-2):
2021/04/05 21:38:31 [DEBUG] Running Sweeper (aws_redshift_cluster) in region (us-west-2)
2021/04/05 21:38:32 [DEBUG] No Redshift clusters to sweep
2021/04/05 21:38:32 [DEBUG] Sweeper (aws_redshift_cluster_snapshot) has dependency (aws_redshift_cluster), running..
2021/04/05 21:38:32 [DEBUG] Sweeper (aws_redshift_cluster) already ran in region (us-west-2)
2021/04/05 21:38:32 [DEBUG] Running Sweeper (aws_redshift_cluster_snapshot) in region (us-west-2)
2021/04/05 21:38:32 [DEBUG] No Redshift cluster snapshots to sweep
2021/04/05 21:38:32 Sweeper Tests ran successfully:
	- aws_redshift_cluster_snapshot
	- aws_redshift_cluster
ok  	github.com/terraform-providers/terraform-provider-aws/aws	2.681s

@YakDriver YakDriver requested a review from a team as a code owner April 5, 2021 22:16
@ghost ghost added size/S Managed by automation to categorize the size of a PR. service/redshift Issues and PRs that pertain to the redshift service. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure. labels Apr 5, 2021
@bflad bflad self-assigned this Apr 7, 2021
@YakDriver YakDriver added this to the v3.36.0 milestone Apr 7, 2021
@YakDriver YakDriver merged commit ce3cfaa into main Apr 7, 2021
@YakDriver YakDriver deleted the td-concsweep-redshift-cluster branch April 7, 2021 17:13
@ghost
Copy link

ghost commented Apr 9, 2021

This has been released in version 3.36.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 May 8, 2021

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 May 8, 2021
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. 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