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

r/dynamodb_tag: change equality check in propagation waiter #39491

Merged
merged 17 commits into from
Sep 26, 2024

Conversation

johnsonaj
Copy link
Contributor

@johnsonaj johnsonaj commented Sep 25, 2024

Description

When multiple tag resources are added the wait function for tag propagation will continuously return false until timeout is reached.

% make testacc TESTARGS='-run=TestAccDynamoDBTag_multipleTags' PKG=dynamodb

make: Verifying source code with gofmt...
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go1.23.1 test ./internal/service/dynamodb/... -v -count 1 -parallel 20  -run=TestAccDynamoDBTag_multipleTags -timeout 360m
=== RUN   TestAccDynamoDBTag_multipleTags
=== PAUSE TestAccDynamoDBTag_multipleTags
=== CONT  TestAccDynamoDBTag_multipleTags
    tag_test.go:142: Step 1/3 error: Error running apply: exit status 1

        Error: creating dynamodb resource (arn:aws:dynamodb:us-west-2:916215835482:table/tf-acc-test-4853890998756051563) tag (key1-2): waiting for resource (arn:aws:dynamodb:us-west-2:916215835482:table/tf-acc-test-4853890998756051563) tag propagation: timeout while waiting for state to become 'TRUE' (last state: 'FALSE', timeout: 2m0s)

          with aws_dynamodb_tag.test2,
          on terraform_plugin_test.tf line 34, in resource "aws_dynamodb_tag" "test2":
          34: resource "aws_dynamodb_tag" "test2" {


        Error: creating dynamodb resource (arn:aws:dynamodb:us-west-2:916215835482:table/tf-acc-test-4853890998756051563) tag (key1-3): waiting for resource (arn:aws:dynamodb:us-west-2:916215835482:table/tf-acc-test-4853890998756051563) tag propagation: timeout while waiting for state to become 'TRUE' (last state: 'FALSE', timeout: 2m0s)

          with aws_dynamodb_tag.test3,
          on terraform_plugin_test.tf line 40, in resource "aws_dynamodb_tag" "test3":
          40: resource "aws_dynamodb_tag" "test3" {

    panic.go:629: Error running post-test destroy, there may be dangling resources: exit status 1

        Error: deleting dynamodb resource (arn:aws:dynamodb:us-west-2:916215835482:table/tf-acc-test-4853890998756051563) tag (key1): waiting for resource (arn:aws:dynamodb:us-west-2:916215835482:table/tf-acc-test-4853890998756051563) tag propagation: timeout while waiting for state to become 'TRUE' (last state: 'FALSE', timeout: 2m0s)

--- FAIL: TestAccDynamoDBTag_multipleTags (265.35s)
FAIL
FAIL	github.com/hashicorp/terraform-provider-aws/internal/service/dynamodb	272.118s
FAIL
make: *** [testacc] Error 1

Relations

Relates #39326

References

Output from Acceptance Testing

% make testacc TESTARGS='-run=TestAccDynamoDBTable_tags\|TestAccDynamoDBTag_' PKG=dynamodb

make: Verifying source code with gofmt...
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go1.23.1 test ./internal/service/dynamodb/... -v -count 1 -parallel 20  -run=TestAccDynamoDBTable_tags\|estAccDynamoDBTag_ -timeout 360m
--- PASS: TestAccDynamoDBTag_disappears (52.15s)
--- PASS: TestAccDynamoDBTable_tags_DefaultTags_emptyResourceTag (59.33s)
--- PASS: TestAccDynamoDBTable_tags_DefaultTags_nullOverlappingResourceTag (59.44s)
--- PASS: TestAccDynamoDBTable_tags_DefaultTags_nullNonOverlappingResourceTag (59.48s)
--- PASS: TestAccDynamoDBTag_basic (60.83s)
--- PASS: TestAccDynamoDBTable_tags_ComputedTag_OnCreate (61.09s)
--- PASS: TestAccDynamoDBTable_tags_DefaultTags_emptyProviderOnlyTag (63.16s)
--- PASS: TestAccDynamoDBTable_tags_DefaultTags_updateToResourceOnly (79.40s)
--- PASS: TestAccDynamoDBTag_value (87.93s)
--- PASS: TestAccDynamoDBTable_tags_AddOnUpdate (88.13s)
--- PASS: TestAccDynamoDBTable_tags_ComputedTag_OnUpdate_Add (88.73s)
--- PASS: TestAccDynamoDBTable_tags_ComputedTag_OnUpdate_Replace (88.77s)
--- PASS: TestAccDynamoDBTable_tags_EmptyTag_OnUpdate_Replace (90.10s)
--- PASS: TestAccDynamoDBTable_tags_EmptyTag_OnCreate (93.62s)
--- PASS: TestAccDynamoDBTable_tags_EmptyMap (49.03s)
--- PASS: TestAccDynamoDBTable_tags_null (44.87s)
--- PASS: TestAccDynamoDBTag_multipleTags (107.51s)
--- PASS: TestAccDynamoDBTable_tags_EmptyTag_OnUpdate_Add (107.82s)
--- PASS: TestAccDynamoDBTable_tags_DefaultTags_updateToProviderOnly (51.96s)
--- PASS: TestAccDynamoDBTable_tags_DefaultTags_nonOverlapping (114.46s)
--- PASS: TestAccDynamoDBTable_tags_DefaultTags_overlapping (118.56s)
--- PASS: TestAccDynamoDBTable_tags (132.15s)
--- PASS: TestAccDynamoDBTable_tags_DefaultTags_providerOnly (94.17s)
--- PASS: TestAccDynamoDBTag_ResourceARN_tableReplica (279.06s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/dynamodb	285.657s

@johnsonaj johnsonaj requested a review from a team as a code owner September 25, 2024 22:56
Copy link

Community Note

Voting for Prioritization

  • Please vote on this pull request by adding a 👍 reaction to the original post to help the community and maintainers prioritize this pull request.
  • Please see our prioritization guide for information on how we prioritize.
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request.

For Submitters

  • Review the contribution guide relating to the type of change you are making to ensure all of the necessary steps have been taken.
  • For new resources and data sources, use skaff to generate scaffolding with comments detailing common expectations.
  • Whether or not the branch has been rebased will not impact prioritization, but doing so is always a welcome surprise.

@github-actions github-actions bot added tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure. service/dynamodb Issues and PRs that pertain to the dynamodb service. tags Pertains to resource tagging. generators Relates to code generators. prioritized Part of the maintainer teams immediate focus. To be addressed within the current quarter. labels Sep 25, 2024
@jar-b jar-b self-assigned this Sep 26, 2024
Copy link
Member

@jar-b jar-b 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=dynamodb TESTS=TestAccDynamoDBTag_
make: Verifying source code with gofmt...
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go1.23.1 test ./internal/service/dynamodb/... -v -count 1 -parallel 20 -run='TestAccDynamoDBTag_'  -timeout 360m

--- PASS: TestAccDynamoDBTag_disappears (29.42s)
--- PASS: TestAccDynamoDBTag_basic (31.94s)
--- PASS: TestAccDynamoDBTag_value (50.12s)
--- PASS: TestAccDynamoDBTag_multipleTags (71.76s)
--- PASS: TestAccDynamoDBTag_ResourceARN_tableReplica (197.23s)
PASS
ok      github.com/hashicorp/terraform-provider-aws/internal/service/dynamodb   204.015s
% make testacc PKG=dynamodb TESTS="TestAccDynamoDBTable_Replica_tagsUpdate|TestAccDynamoDBTableReplica_basic|TestAccDynamoDBTableReplica_tableClass|TestAccDynamoDBTableReplica_tags"
make: Verifying source code with gofmt...
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go1.23.1 test ./internal/service/dynamodb/... -v -count 1 -parallel 20 -run='TestAccDynamoDBTable_Replica_tagsUpdate|TestAccDynamoDBTableReplica_basic|TestAccDynamoDBTableRepl
ica_tableClass|TestAccDynamoDBTableReplica_tags'  -timeout 360m

--- PASS: TestAccDynamoDBTableReplica_basic (259.24s)
--- PASS: TestAccDynamoDBTableReplica_tags (311.55s)
--- PASS: TestAccDynamoDBTableReplica_tableClass (372.02s)
--- PASS: TestAccDynamoDBTable_Replica_tagsUpdate (431.19s)
PASS
ok      github.com/hashicorp/terraform-provider-aws/internal/service/dynamodb   436.395s

@@ -22,7 +22,7 @@ func {{ .WaitTagsPropagatedFunc }}(ctx context.Context, conn {{ .ClientType }},
output = output.IgnoreConfig(inContext.IgnoreConfig)
}

return output.Equal(tags), nil
return output.{{ .WaitFuncComparator }}(tags), nil
Copy link
Member

Choose a reason for hiding this comment

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

Nice 👍

@jar-b
Copy link
Member

jar-b commented Sep 26, 2024

Just needs a changelog.

Copy link
Member

@jar-b jar-b 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=dynamodb TESTS=TestAccDynamoDBTag_
make: Verifying source code with gofmt...
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go1.23.1 test ./internal/service/dynamodb/... -v -count 1 -parallel 20 -run='TestAccDynamoDBTag_'  -timeout 360m

--- PASS: TestAccDynamoDBTag_disappears (29.61s)
--- PASS: TestAccDynamoDBTag_basic (32.12s)
--- PASS: TestAccDynamoDBTag_value (43.81s)
--- PASS: TestAccDynamoDBTag_multipleTags (78.89s)
--- PASS: TestAccDynamoDBTag_ResourceARN_tableReplica (185.82s)
PASS
ok      github.com/hashicorp/terraform-provider-aws/internal/service/dynamodb   191.120s
% make testacc PKG=dynamodb TESTS=TestAccDynamoDBTable_tags
make: Verifying source code with gofmt...
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go1.23.1 test ./internal/service/dynamodb/... -v -count 1 -parallel 20 -run='TestAccDynamoDBTable_tags'  -timeout 360m

--- PASS: TestAccDynamoDBTable_tags_DefaultTags_emptyResourceTag (67.35s)
--- PASS: TestAccDynamoDBTable_tags_DefaultTags_nullNonOverlappingResourceTag (68.77s)
--- PASS: TestAccDynamoDBTable_tags_DefaultTags_nullOverlappingResourceTag (68.82s)
--- PASS: TestAccDynamoDBTable_tags_DefaultTags_emptyProviderOnlyTag (69.06s)
--- PASS: TestAccDynamoDBTable_tags_ComputedTag_OnCreate (69.22s)
--- PASS: TestAccDynamoDBTable_tags_null (74.51s)
--- PASS: TestAccDynamoDBTable_tags_EmptyMap (76.45s)
--- PASS: TestAccDynamoDBTable_tags_DefaultTags_updateToResourceOnly (83.99s)
--- PASS: TestAccDynamoDBTable_tags_DefaultTags_updateToProviderOnly (86.20s)
--- PASS: TestAccDynamoDBTable_tags_AddOnUpdate (87.75s)
--- PASS: TestAccDynamoDBTable_tags_ComputedTag_OnUpdate_Replace (91.05s)
--- PASS: TestAccDynamoDBTable_tags_EmptyTag_OnUpdate_Replace (93.37s)
--- PASS: TestAccDynamoDBTable_tags_ComputedTag_OnUpdate_Add (93.65s)
--- PASS: TestAccDynamoDBTable_tags_EmptyTag_OnCreate (97.06s)
--- PASS: TestAccDynamoDBTable_tags_EmptyTag_OnUpdate_Add (110.56s)
--- PASS: TestAccDynamoDBTable_tags_DefaultTags_nonOverlapping (118.47s)
--- PASS: TestAccDynamoDBTable_tags_DefaultTags_overlapping (120.41s)
--- PASS: TestAccDynamoDBTable_tags (131.51s)
--- PASS: TestAccDynamoDBTable_tags_DefaultTags_providerOnly (137.57s)
PASS
ok      github.com/hashicorp/terraform-provider-aws/internal/service/dynamodb   144.437s

@johnsonaj johnsonaj merged commit da8ec27 into main Sep 26, 2024
46 of 47 checks passed
@johnsonaj johnsonaj deleted the b-dynamodb_tags_propagation branch September 26, 2024 20:58
@github-actions github-actions bot added this to the v5.69.0 milestone Sep 26, 2024
terraform-aws-provider bot pushed a commit that referenced this pull request Sep 26, 2024
Copy link

This functionality has been released in v5.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 github-actions bot removed the prioritized Part of the maintainer teams immediate focus. To be addressed within the current quarter. label Sep 26, 2024
Copy link

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 Oct 28, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
generators Relates to code generators. service/dynamodb Issues and PRs that pertain to the dynamodb service. tags Pertains to resource tagging. 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.

3 participants