magic-modules icon indicating copy to clipboard operation
magic-modules copied to clipboard

GCVE Resource Optimisation for Acceptance Tests

Open swamitagupta opened this issue 1 year ago • 54 comments

This pull request is a part of the efforts to reduce Vmwareengine resource usage in Terraform acceptance tests without facing a resource - time tradeoff. The same is further described at go/gcve-resource-optimisation-for-tf-tests.

Release Note Template for Downstream PRs (will be copied)


swamitagupta avatar Jun 18 '24 09:06 swamitagupta

Hello! I am a robot. Tests will require approval from a repository maintainer to run.

@SarahFrench, a repository maintainer, has been assigned to review your changes. If you have not received review feedback within 2 business days, please leave a comment on this PR asking them to take a look.

You can help make sure that review is quick by doing a self-review and by running impacted tests locally.

github-actions[bot] avatar Jun 18 '24 09:06 github-actions[bot]

Hi there, I'm the Modular magician. I've detected the following information about your changes:

Diff report

Your PR generated some diffs in downstreams - here they are.

google provider: Diff ( 8 files changed, 201 insertions(+), 497 deletions(-)) google-beta provider: Diff ( 8 files changed, 201 insertions(+), 497 deletions(-))

modular-magician avatar Jun 18 '24 09:06 modular-magician

Tests analytics

Total tests: 14 Passed tests: 8 Skipped tests: 2 Affected tests: 4

Click here to see the affected service packages
  • vmwareengine

Action taken

Found 4 affected test(s) by replaying old test recordings. Starting RECORDING based on the most recent commit. Click here to see the affected tests
TestAccVmwareengineExternalAddress_vmwareEngineExternalAddressUpdate|TestAccVmwareengineNetworkPeering_update|TestAccVmwareengineNetworkPolicy_update|TestAccVmwareengineNetwork_vmwareEngineNetworkUpdate

Get to know how VCR tests work

modular-magician avatar Jun 18 '24 09:06 modular-magician

$\textcolor{green}{\textsf{Tests passed during RECORDING mode:}}$ TestAccVmwareengineNetwork_vmwareEngineNetworkUpdate[Debug log]

$\textcolor{green}{\textsf{No issues found for passed tests after REPLAYING rerun.}}$


$\textcolor{red}{\textsf{Tests failed during RECORDING mode:}}$ TestAccVmwareengineExternalAddress_vmwareEngineExternalAddressUpdate[Error message] [Debug log] TestAccVmwareengineNetworkPeering_update[Error message] [Debug log] TestAccVmwareengineNetworkPolicy_update[Error message] [Debug log]

$\textcolor{red}{\textsf{Please fix these to complete your PR.}}$ View the build log or the debug log for each test

modular-magician avatar Jun 18 '24 09:06 modular-magician

Hi there, I'm the Modular magician. I've detected the following information about your changes:

Diff report

Your PR generated some diffs in downstreams - here they are.

google provider: Diff ( 8 files changed, 201 insertions(+), 497 deletions(-)) google-beta provider: Diff ( 8 files changed, 201 insertions(+), 497 deletions(-))

modular-magician avatar Jun 18 '24 10:06 modular-magician

Tests analytics

Total tests: 14 Passed tests: 9 Skipped tests: 2 Affected tests: 3

Click here to see the affected service packages
  • vmwareengine

Action taken

Found 3 affected test(s) by replaying old test recordings. Starting RECORDING based on the most recent commit. Click here to see the affected tests
TestAccVmwareengineExternalAddress_vmwareEngineExternalAddressUpdate|TestAccVmwareengineNetworkPeering_update|TestAccVmwareengineNetworkPolicy_update

Get to know how VCR tests work

modular-magician avatar Jun 18 '24 10:06 modular-magician

$\textcolor{red}{\textsf{Tests failed during RECORDING mode:}}$ TestAccVmwareengineExternalAddress_vmwareEngineExternalAddressUpdate[Error message] [Debug log] TestAccVmwareengineNetworkPeering_update[Error message] [Debug log] TestAccVmwareengineNetworkPolicy_update[Error message] [Debug log]

$\textcolor{red}{\textsf{Please fix these to complete your PR.}}$ View the build log or the debug log for each test

modular-magician avatar Jun 18 '24 10:06 modular-magician

Hi @SarahFrench The tests seem to be failing since the test project already has ~10 Vmware Engine Networks created at the moment. Could you please clear up all the existing vmwareengine resources of this project? Thanks

swamitagupta avatar Jun 18 '24 10:06 swamitagupta

Hi @swamitagupta - I'll do my best but as I'm not a Google employee I cannot access the test project directly. I'll see what options are available to me and will ask for the core Terraform team at Google for help after.

SarahFrench avatar Jun 18 '24 13:06 SarahFrench

I used test project sweepers to remove some google_vmwareengine_network in global and some regions too. Re-running tests: /gcbrun

SarahFrench avatar Jun 18 '24 13:06 SarahFrench

Hi there, I'm the Modular magician. I've detected the following information about your changes:

Diff report

Your PR generated some diffs in downstreams - here they are.

google provider: Diff ( 8 files changed, 201 insertions(+), 497 deletions(-)) google-beta provider: Diff ( 8 files changed, 201 insertions(+), 497 deletions(-))

modular-magician avatar Jun 18 '24 13:06 modular-magician

Tests analytics

Total tests: 14 Passed tests: 9 Skipped tests: 2 Affected tests: 3

Click here to see the affected service packages
  • vmwareengine

Action taken

Found 3 affected test(s) by replaying old test recordings. Starting RECORDING based on the most recent commit. Click here to see the affected tests
TestAccVmwareengineExternalAddress_vmwareEngineExternalAddressUpdate|TestAccVmwareengineNetworkPeering_update|TestAccVmwareengineNetworkPolicy_update

Get to know how VCR tests work

modular-magician avatar Jun 18 '24 14:06 modular-magician

$\textcolor{red}{\textsf{Tests failed during RECORDING mode:}}$ TestAccVmwareengineExternalAddress_vmwareEngineExternalAddressUpdate[Error message] [Debug log] TestAccVmwareengineNetworkPeering_update[Error message] [Debug log] TestAccVmwareengineNetworkPolicy_update[Error message] [Debug log]

$\textcolor{red}{\textsf{Please fix these to complete your PR.}}$ View the build log or the debug log for each test

modular-magician avatar Jun 18 '24 14:06 modular-magician

I found that our sweeper for cleaning up these resources isn't able to delete these resources - once I have my PR to fix that merged it should unblock your progress: https://github.com/GoogleCloudPlatform/magic-modules/pull/10994

SarahFrench avatar Jun 18 '24 16:06 SarahFrench

Thanks @SarahFrench Please also check if there are any Private Clouds dependant on these VENs which might fail their deletion. There has been a recent change due to which PC Deletions can go long for as long as 24 hrs. This might cause a surge in dangling VENs as well. This change would impact these tests temporarily.

swamitagupta avatar Jun 18 '24 16:06 swamitagupta

I'm working on it - I am making the existing google_vmwareengine_network sweeper more effective, and I'm adding a sweeper for google_vmwareengine_private_cloud as this wasn't added in the past. Once the latter is in place I will be able to delete these resources in the projects I cannot access directly

SarahFrench avatar Jun 19 '24 09:06 SarahFrench

Acknowledged, thank you @SarahFrench

swamitagupta avatar Jun 19 '24 09:06 swamitagupta

/gcbrun

SarahFrench avatar Jun 20 '24 12:06 SarahFrench

Hi there, I'm the Modular magician. I've detected the following information about your changes:

Diff report

Your PR generated some diffs in downstreams - here they are.

google provider: Diff ( 8 files changed, 201 insertions(+), 497 deletions(-)) google-beta provider: Diff ( 8 files changed, 201 insertions(+), 497 deletions(-))

modular-magician avatar Jun 20 '24 12:06 modular-magician

Tests analytics

Total tests: 14 Passed tests: 9 Skipped tests: 2 Affected tests: 3

Click here to see the affected service packages
  • vmwareengine

Action taken

Found 3 affected test(s) by replaying old test recordings. Starting RECORDING based on the most recent commit. Click here to see the affected tests
TestAccVmwareengineExternalAddress_vmwareEngineExternalAddressUpdate|TestAccVmwareengineNetworkPeering_update|TestAccVmwareengineNetworkPolicy_update

Get to know how VCR tests work

modular-magician avatar Jun 20 '24 12:06 modular-magician

$\textcolor{green}{\textsf{Tests passed during RECORDING mode:}}$ TestAccVmwareengineNetworkPeering_update[Debug log] TestAccVmwareengineNetworkPolicy_update[Debug log]

$\textcolor{green}{\textsf{No issues found for passed tests after REPLAYING rerun.}}$


$\textcolor{red}{\textsf{Tests failed during RECORDING mode:}}$ TestAccVmwareengineExternalAddress_vmwareEngineExternalAddressUpdate[Error message] [Debug log]

$\textcolor{red}{\textsf{Please fix these to complete your PR.}}$ View the build log or the debug log for each test

modular-magician avatar Jun 20 '24 15:06 modular-magician

Hi there, I'm the Modular magician. I've detected the following information about your changes:

Diff report

Your PR generated some diffs in downstreams - here they are.

google provider: Diff ( 8 files changed, 202 insertions(+), 498 deletions(-)) google-beta provider: Diff ( 8 files changed, 202 insertions(+), 498 deletions(-))

modular-magician avatar Jun 21 '24 06:06 modular-magician

Tests analytics

Total tests: 14 Passed tests: 11 Skipped tests: 2 Affected tests: 1

Click here to see the affected service packages
  • vmwareengine

Action taken

Found 1 affected test(s) by replaying old test recordings. Starting RECORDING based on the most recent commit. Click here to see the affected tests
TestAccVmwareengineExternalAddress_vmwareEngineExternalAddressUpdate

Get to know how VCR tests work

modular-magician avatar Jun 21 '24 06:06 modular-magician

$\textcolor{red}{\textsf{Several tests got terminated during RECORDING mode.}}$ View the build log or the debug log for each test

modular-magician avatar Jun 21 '24 10:06 modular-magician

/gcbrun

swamitagupta avatar Jun 21 '24 10:06 swamitagupta

Hi there, I'm the Modular magician. I've detected the following information about your changes:

Diff report

Your PR generated some diffs in downstreams - here they are.

google provider: Diff ( 8 files changed, 202 insertions(+), 498 deletions(-)) google-beta provider: Diff ( 8 files changed, 202 insertions(+), 498 deletions(-))

modular-magician avatar Jun 21 '24 10:06 modular-magician

Tests analytics

Total tests: 14 Passed tests: 11 Skipped tests: 2 Affected tests: 1

Click here to see the affected service packages
  • vmwareengine

Action taken

Found 1 affected test(s) by replaying old test recordings. Starting RECORDING based on the most recent commit. Click here to see the affected tests
TestAccVmwareengineExternalAddress_vmwareEngineExternalAddressUpdate

Get to know how VCR tests work

modular-magician avatar Jun 21 '24 10:06 modular-magician

$\textcolor{red}{\textsf{Several tests got terminated during RECORDING mode.}}$ View the build log or the debug log for each test

modular-magician avatar Jun 21 '24 14:06 modular-magician

It looks like that test (TestAccVmwareengineExternalAddress_vmwareEngineExternalAddressUpdate ) is failing due to hitting the 4 hour timeout limit - I'll have a go running the test in our non-VCR test environment

Note to self: test here

SarahFrench avatar Jun 21 '24 15:06 SarahFrench

From running the test above, it failed with an opaque error:

Step 3/8 error: Error running apply: exit status 1
            
            Error: Error waiting for Updating ExternalAddress: Error code 13, message: an internal error has occurred
            
              with google_vmwareengine_external_address.vmw-engine-external-address-primary,
              on terraform_plugin_test.tf line 41, in resource "google_vmwareengine_external_address" "vmw-engine-external-address-primary":
              41: resource "google_vmwareengine_external_address" "vmw-engine-external-address-primary" {

SarahFrench avatar Jun 24 '24 20:06 SarahFrench