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

Fix for missing return statement #10165

Merged
merged 1 commit into from
Sep 24, 2019
Merged

Conversation

obourdon
Copy link
Contributor

Without this fix, there are most probably
some cases where errors will not be risen
properly

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" comments, they generate extra noise for pull request followers and do not help prioritize the request

Relates OR Closes #0000

Release note for CHANGELOG:

fix missing return statement for errors to raise properly when deleting security groups

Output from acceptance testing:

$ make testacc TESTARGS='-run=TestAccXXX'

...

Without this fix, there are most probably
some cases where errors will not be risen
properly
@obourdon obourdon requested a review from a team September 19, 2019 12:27
@ghost ghost added size/XS Managed by automation to categorize the size of a PR. service/ec2 Issues and PRs that pertain to the ec2 service. labels Sep 19, 2019
@obourdon
Copy link
Contributor Author

I am currently traveling by train and will run acceptance tests as soon as I have access to a stable internet connection
@ryndaniels surely you can have a quick look at this very easy one ;-)

@obourdon
Copy link
Contributor Author

Seems like I always hit some AWS limit when running:

AWS_DEFAULT_REGION=us-west-2 AWS_PROFILE=dev make testacc TEST=./aws TESTARGS='-run=TestAccAWSSecurityGroup'
        Error: Error creating VPC: VpcLimitExceeded: The maximum number of VPCs has been reached.

Looking into my VPC dashboard I have 5 additional VPCs which have been created side to the default one ...
Any idea what I am doing wrong ?

@bflad
Copy link
Contributor

bflad commented Sep 24, 2019

Any idea what I am doing wrong ?

Hey @obourdon! 👋 You're not doing anything wrong. The acceptance testing runs with concurrency set to 20 by default when using make testacc: https://github.com/terraform-providers/terraform-provider-aws/blob/fc414876d3ccbc16564fb98a15fc83df880e3c76/GNUmakefile#L19-L20

This means we can need up to 20 available VPCs when running this type of testing. 👍 You can lower this concurrency by running the go test command directly with a lower parallel value, e.g.

$ AWS_DEFAULT_REGION=us-west-2 AWS_PROFILE=dev TF_ACC=1 go test ./aws -v -parallel 5 -run='TestAccAWSSecurityGroup_'

This definitely seems like something we should note in our contributing guide. We'll take that as feedback and ensure our environment expectations are clearer.

@bflad bflad added the bug Addresses a defect in current functionality. label Sep 24, 2019
@bflad bflad added this to the v2.30.0 milestone Sep 24, 2019
Copy link
Contributor

@bflad bflad left a comment

Choose a reason for hiding this comment

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

Great catch, thanks for fixing this, @obourdon 🚀

--- PASS: TestAccAWSSecurityGroupRule_ExpectInvalidTypeError (4.62s)
--- PASS: TestAccAWSSecurityGroupRule_ExpectInvalidCIDR (6.66s)
--- PASS: TestAccAWSSecurityGroupRule_SelfReference (22.87s)
--- PASS: TestAccAWSSecurityGroupRule_Egress (24.52s)
--- PASS: TestProtocolStateFunc (0.00s)
--- PASS: TestAccAWSSecurityGroupRule_IngressDescription (24.60s)
--- PASS: TestProtocolForValue (0.00s)
--- PASS: TestResourceAwsSecurityGroupExpandCollapseRules (0.00s)
--- PASS: TestResourceAwsSecurityGroupIPPermGather (0.00s)
--- PASS: TestAccAWSSecurityGroupRule_MultiIngress (27.14s)
--- PASS: TestAccAWSSecurityGroupRule_Ingress_Classic (29.62s)
--- PASS: TestAccAWSSecurityGroupRule_SelfSource (29.98s)
--- PASS: TestAccAWSSecurityGroupRule_PartialMatching_Source (32.74s)
--- PASS: TestAccAWSSecurityGroupRule_EgressDescription_updates (34.63s)
--- PASS: TestAccAWSSecurityGroupRule_Ingress_VPC (35.18s)
--- PASS: TestAccAWSSecurityGroupRule_Issue5310 (35.80s)
--- PASS: TestAccAWSSecurityGroupRule_IngressDescription_updates (37.28s)
--- PASS: TestAccAWSSecurityGroupRule_Description_AllPorts_NonZeroPorts (38.81s)
--- PASS: TestAccAWSSecurityGroupRule_Ingress_Ipv6 (45.58s)
--- PASS: TestAccAWSSecurityGroupRule_PrefixListEgress (45.63s)
--- PASS: TestAccAWSSecurityGroupRule_Ingress_Protocol (49.64s)
--- PASS: TestAccAWSSecurityGroupRule_Description_AllPorts (51.26s)
--- PASS: TestAccAWSSecurityGroupRule_PartialMatching_basic (52.32s)
--- PASS: TestAccAWSSecurityGroupRule_MultipleRuleSearching_AllProtocolCrash (47.97s)
--- PASS: TestAccAWSSecurityGroupRule_EgressDescription (63.60s)
--- PASS: TestAccAWSSecurityGroup_namePrefix (14.31s)
--- PASS: TestAccAWSSecurityGroup_importSelf (40.64s)
--- PASS: TestAccAWSSecurityGroup_importIPRangesWithSameRules (35.39s)
--- PASS: TestAccAWSSecurityGroup_basic (41.98s)
--- PASS: TestAccAWSSecurityGroup_importBasic (56.37s)
--- PASS: TestAccAWSSecurityGroup_importSourceSecurityGroup (57.94s)
--- PASS: TestAccAWSSecurityGroup_ipv6 (39.61s)
--- SKIP: TestAccAWSSecurityGroup_DefaultEgress_Classic (1.04s)
--- PASS: TestAccAWSSecurityGroup_self (38.29s)
--- PASS: TestAccAWSSecurityGroup_vpc (39.26s)
--- PASS: TestAccAWSSecurityGroup_importIPRangeAndSecurityGroupWithSameRules (64.37s)
--- PASS: TestAccAWSSecurityGroup_invalidCIDRBlock (1.82s)
--- PASS: TestAccAWSSecurityGroup_importPrefixList (61.63s)
--- PASS: TestAccAWSSecurityGroup_ruleGathering (52.85s)
--- SKIP: TestAccAWSSecurityGroup_ingressWithCidrAndSGs_classic (1.19s)
--- PASS: TestAccAWSSecurityGroup_importIpv6 (76.25s)
--- PASS: TestAccAWSSecurityGroup_vpcProtoNumIngress (37.50s)
--- PASS: TestAccAWSSecurityGroup_vpcNegOneIngress (40.56s)
--- PASS: TestAccAWSSecurityGroup_Egress_ConfigMode (69.00s)
--- PASS: TestAccAWSSecurityGroup_DefaultEgress_VPC (31.88s)
--- PASS: TestAccAWSSecurityGroup_drift_complex (30.58s)
--- PASS: TestAccAWSSecurityGroup_MultiIngress (62.41s)
--- PASS: TestAccAWSSecurityGroup_drift (40.64s)
--- PASS: TestAccAWSSecurityGroup_failWithDiffMismatch (30.55s)
--- PASS: TestAccAWSSecurityGroup_Ingress_ConfigMode (97.22s)
--- PASS: TestAccAWSSecurityGroup_CIDRandGroups (39.83s)
--- PASS: TestAccAWSSecurityGroup_ingressWithCidrAndSGs (42.82s)
--- PASS: TestAccAWSSecurityGroup_ingressWithPrefixList (40.08s)
--- PASS: TestAccAWSSecurityGroup_egressWithPrefixList (49.51s)
--- PASS: TestAccAWSSecurityGroup_tags (53.25s)
--- PASS: TestAccAWSSecurityGroup_ruleLimitCidrBlockExceededAppend (28.98s)
--- PASS: TestAccAWSSecurityGroupRule_MultiDescription (126.78s)
--- PASS: TestAccAWSSecurityGroup_generatedName (69.02s)
--- PASS: TestAccAWSSecurityGroup_ruleLimitExceededAppend (50.50s)
--- PASS: TestAccAWSSecurityGroup_rulesDropOnError (35.13s)
--- PASS: TestAccAWSSecurityGroup_ruleLimitExceededAllNew (35.80s)
--- PASS: TestAccAWSSecurityGroup_ruleLimitExceededPrepend (53.73s)
--- PASS: TestAccAWSSecurityGroup_RuleDescription (98.78s)
--- PASS: TestAccAWSSecurityGroup_Change (116.62s)
--- PASS: TestAccAWSSecurityGroupRule_Race (193.76s)
--- PASS: TestAccAWSSecurityGroup_ipv4andipv6Egress (114.97s)
--- PASS: TestAccAWSSecurityGroup_forceRevokeRules_false (1242.12s)
--- PASS: TestAccAWSSecurityGroup_forceRevokeRules_true (1254.84s)

@bflad bflad merged commit fc735e8 into hashicorp:master Sep 24, 2019
bflad added a commit that referenced this pull request Sep 24, 2019
@obourdon obourdon deleted the fix-missing-return branch September 25, 2019 15:32
@obourdon
Copy link
Contributor Author

Thanks for this merge and advices on how to pass acceptance test "safely" @bflad.

@ghost
Copy link

ghost commented Sep 26, 2019

This has been released in version 2.30.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 1, 2019

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 and limited conversation to collaborators Nov 1, 2019
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/ec2 Issues and PRs that pertain to the ec2 service. size/XS Managed by automation to categorize the size of a PR.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants