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

networkfirewall/resource_policy: Disappears test failing #22174

Closed
YakDriver opened this issue Dec 10, 2021 · 2 comments · Fixed by #22402
Closed

networkfirewall/resource_policy: Disappears test failing #22174

YakDriver opened this issue Dec 10, 2021 · 2 comments · Fixed by #22402
Assignees
Labels
service/networkfirewall Issues and PRs that pertain to the networkfirewall service. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure.

Comments

@YakDriver
Copy link
Member

YakDriver commented Dec 10, 2021

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue 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 issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Relates #16774
Relates #16780

Affected Test(s)

  • aws_networkfirewall_resource_policy - TestAccNetworkFirewallResourcePolicy_disappears

NOTE: The other tests are passing. I don't see anything obviously wrong with it and there are other disappears tests that are working.

Expected Behavior

  • tests should be passing in commerical

Actual Behavior

  • Tests erroring with:
resource_policy_test.go:114: Step 1/1 error: Check failed: Check 2/2 error: error deleting resource: error deleting NetworkFirewall Resource Policy (for resource: arn:aws:network-firewall:us-west-2:123456789012:firewall-policy/tf-acc-test-1738147754193226966): InvalidResourcePolicyException: The supplied policy does not match RAM managed permissions.
    testing_new.go:70: Error running post-test destroy, there may be dangling resources: exit status 1
        
        Error: error deleting NetworkFirewall Resource Policy (for resource: arn:aws:network-firewall:us-west-2:123456789012:firewall-policy/tf-acc-test-1738147754193226966): InvalidResourcePolicyException: The supplied policy does not match RAM managed permissions.
@github-actions github-actions bot added the service/networkfirewall Issues and PRs that pertain to the networkfirewall service. label Dec 10, 2021
@YakDriver YakDriver assigned YakDriver and anGie44 and unassigned YakDriver Dec 10, 2021
@anGie44
Copy link
Contributor

anGie44 commented Jan 4, 2022

Looks like an eventual consistency-ish behavior b/c if i add a retry condition on that error message

err := resource.RetryContext(ctx, iam.PropagationTimeout, func() *resource.RetryError {
		_, err := conn.DeleteResourcePolicyWithContext(ctx, input)
		if err != nil {
			if tfawserr.ErrMessageContains(err, networkfirewall.ErrCodeInvalidResourcePolicyException, "The supplied policy does not match RAM managed permissions") {
				return resource.RetryableError(err)
			}
			return resource.NonRetryableError(err)
		}
		return nil
	})

the delete will eventually succeed 😕 if there was a way to check on the resource policy during create we could probably do the handling there but atm I don't see an API method that we can work with

@anGie44 anGie44 added the tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure. label Jan 4, 2022
@github-actions
Copy link

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 have found a problem that seems similar to this, 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 May 22, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
service/networkfirewall Issues and PRs that pertain to the networkfirewall service. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure.
Projects
None yet
2 participants