hashicorp / terraform-provider-google

Terraform Provider for Google Cloud Platform
https://registry.terraform.io/providers/hashicorp/google/latest/docs
Mozilla Public License 2.0
2.33k stars 1.73k forks source link

Failing test(s): compute disk + storage pool #19199

Closed melinath closed 1 month ago

melinath commented 2 months ago

Impacted tests

Affected Resource(s)

Failure rates

These were failing 100% in PRs due to quota issues. I've deleted the resources causing the quota issue, so this is temporarily resolved, but it could happen again at any time (or start failing in nightly test environments.)

Message(s)

resource_compute_disk_test.go:1655: Error creating StoragePool: googleapi: Error 400: Maximum storage pools in this zone has been reached. Please delete an existing storage pool before creating a new storage pool., badRequest

This comes from the setupTestingStoragePool function, and happens because deletion of the existing resources wasn't successful at one point. Specifically, Hyperdisk Balanced Storage Pools Advanced Iops was at 100%.

Ideally, the storage pools would be implemented as a separate Terraform resource, which would have a sweeper that would automatically clean up any trailing pools on a regular basis.

Alternatively, I think it would be possible to implement a sweeper on its own, without a resource - it just wouldn't be autogenerated. https://github.com/hashicorp/terraform-provider-google/issues/17891 has some information about how to write sweepers.

Another mitigation would be to make the storage pools use less IOPS quota each - this would be great to do, but would not replace the need to have a sweeper - it would just make us less likely to hit the quota before the sweeper runs each night.

Nightly build test history

Example failure: https://github.com/GoogleCloudPlatform/magic-modules/pull/11504#issuecomment-2299949158

b/361323245

sizzle0121 commented 2 months ago

We avoid adding storage pools as a Terraform resource, since Terraform will plan to delete all the disks in a storage pool when users only want to delete the storage pool, which is risky and not we want. Therefore, I think adding handwritten sweeper would be a better solution.

c2thorn commented 2 months ago

Going to skip in VCR for now: https://github.com/GoogleCloudPlatform/magic-modules/pull/11522

melinath commented 2 months ago

@c2thorn these should be passing now, since the resources were deleted - not sure we need to skip them in VCR.

github-actions[bot] commented 3 weeks ago

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.