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

Failing test(s): Folder not found issues #10286

Comments

@melinath
Copy link
Collaborator

melinath commented Oct 8, 2021

Failure rate: ???

Impacted tests:

  • TestAccLoggingFolderSink_described
  • TestAccLoggingFolderSink_disabled
  • TestAccLoggingFolderSink_update
  • TestAccLoggingFolderSink_removeOptionals
  • TestAccLoggingFolderSink_folderAcceptsFullFolderPath
  • TestAccLoggingFolderSink_updateBigquerySink
  • TestAccLoggingFolderSink_heredoc
  • TestAccLoggingFolderSink_basic
  • TestAccFolderOrganizationPolicy_list_update
  • TestAccFolderOrganizationPolicy_list_allowSome
  • TestAccFolderOrganizationPolicy_list_denySome
  • TestAccFolderOrganizationPolicy_restore_defaultTrue
  • TestAccFolderOrganizationPolicy_boolean
  • TestAccFolderIamPolicy_auditConfigs
  • TestAccFolderIamMember_basic
  • TestAccFolderIamMember_multiple
  • TestAccFolderIamMember_remove
  • TestAccFolderIamBinding_basic
  • TestAccFolderIamBinding_update
  • TestAccFolderIamBinding_remove
  • TestAccFolderIamBinding_multiple
  • TestAccFolderIamBinding_multipleAtOnce
  • TestAccFolder_rename
  • TestAccFolder_moveParent
  • TestAccComputeFirewallPolicy_update
  • TestAccComputeFirewallPolicyRule_multipleRules
  • TestAccFolderIamAuditConfig_basic
  • TestAccFolderIamAuditConfig_updateNoExemptMembers
  • TestAccFolderIamAuditConfig_remove
  • TestAccFolderIamAuditConfig_addFirstExemptMember
  • TestAccFolderIamAuditConfig_removeLastExemptMember
  • TestAccFolderIamAuditConfig_update
  • TestAccFolderIamAuditConfig_multiple
  • TestAccFolderIamAuditConfig_multipleAtOnce
  • TestAccDataSourceGoogleFolders_basic
  • TestAccDataSourceGoogleFolder_lookupOrganization
  • TestAccDataSourceGoogleActiveFolder_dash
  • TestAccDataSourceGoogleActiveFolder_space
  • TestAccDataSourceGoogleActiveFolder_default

Nightly builds:

PR builds:

Message:

Error: Error creating folder 'tf-test-folder-gkug6e9og8' in 'organizations/*******': Error waiting for creating folder: Error code 9, message: Folder reservation failed for parent [organizations/*******], folder [] due to constraint: The folder operation violates fanout constraints.

Fanout contraints are documented here: https://cloud.google.com/resource-manager/reference/rest/v3/folders/create

The addition of the folder must not cause the total number of folders under its parent to exceed 300.

This probably means something is going wrong with sweeping test folders?

@nat-henderson
Copy link
Contributor

Also

  • TestAccLoggingFolderExclusion
  • TestAccFolderOrganizationPolicy_*
  • TestAccFolderIamAuditConfig_*

and a whole ton of others. i'll just go delete em myself real quick.

@nat-henderson
Copy link
Contributor

Hm, easier said than done. I got a few dozen with

for fid in $(gcloud resource-manager folders list --organization $ORG_ID | grep "^tf-test-" | awk '{print $3}'); do gcloud resource-manager folders delete $fid; done; 

but that's not enough, I mostly got "folder not empty". Which would explain why we're having sweeper problems! That's where I'd look next.

@rileykarson
Copy link
Collaborator

Marking as large because we probably need a bigger solution than we've currently got (and a manual cleanup will probably fix it for a while, but the problem will recur)

@rileykarson rileykarson added this to the Near-Term Goals milestone Oct 11, 2021
@rileykarson rileykarson changed the title Failing test(s): Folder Fanout constraint Failing test(s): Folder not found issues Mar 28, 2022
@rileykarson
Copy link
Collaborator

rileykarson commented Mar 28, 2022

Note: fanout constraints are resolved, but we're seeing issues finding folders in tests

provider_test.go:309: Step 1/2 error: Check failed: Check 1/1 error: Failed to retrieve IAM Policy for folder "tf-test-7injbpe84c": expected exactly 1 folder, found 0

@ScottSuarez
Copy link
Collaborator

ScottSuarez commented Apr 7, 2022

There looks to be some sort of latency between a folder being created and a folder being searchable on the API.

I've created b/228499462

@melinath
Copy link
Collaborator Author

melinath commented Apr 21, 2022

based on the response - It looks like getFolderIamPolicyByParentAndDisplayName uses Folders.Search, which is eventually consistent. Switching to Folders.List might work better since it's strongly consistent. At least for tests that rely on that function.

@github-actions
Copy link

github-actions bot commented Jun 6, 2022

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 Jun 6, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.