Skip to content

Fix Compute Instance performance monitoring VCR failure - #17887

Merged
malhotrasagar2212 merged 1 commit into
GoogleCloudPlatform:mainfrom
Capstan:fix-compute-perf-mon
Jun 24, 2026
Merged

Fix Compute Instance performance monitoring VCR failure#17887
malhotrasagar2212 merged 1 commit into
GoogleCloudPlatform:mainfrom
Capstan:fix-compute-perf-mon

Conversation

@Capstan

@Capstan Capstan commented Jun 6, 2026

Copy link
Copy Markdown
Member

This PR resolves the TestAccComputeInstance_performanceMonitoringUnit VCR test failure by adding an EmptyOrDefaultStringSuppress("STANDARD") diff suppress function to the performance_monitoring_unit field in advanced_machine_features.

The Compute Engine API recently began returning "STANDARD" as the default value for this field even when it is not explicitly configured, which caused an ImportStateVerify diff mismatch in Terraform.

Fixes hashicorp/terraform-provider-google#24761

Release Note Template for Downstream PRs (will be copied)

compute: fixed a permadiff where `advanced_machine_features.performance_monitoring_unit` would incorrectly show a diff when defaulting to `STANDARD`
container: fixed a permadiff where `node_config.advanced_machine_features.performance_monitoring_unit` would incorrectly show a diff when defaulting to `STANDARD`

@modular-magician

modular-magician commented Jun 6, 2026

Copy link
Copy Markdown
Collaborator

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

Diff report

Your PR generated the following diffs in downstream repositories:

Repository Diff Link Changes
google provider View Diff 4 files changed, 23 insertions(+), 19 deletions(-)
google-beta provider View Diff 4 files changed, 23 insertions(+), 19 deletions(-)

Missing test report

Your PR includes resource fields which are not covered by any test.

Resource: google_compute_instance_from_machine_image (20 total tests)
Please add an acceptance test which includes these fields. The test should include the following:

resource "google_compute_instance_from_machine_image" "primary" {
  advanced_machine_features {
    performance_monitoring_unit = # value needed
  }
}

Resource: google_compute_instance_from_template (30 total tests)
Please add an acceptance test which includes these fields. The test should include the following:

resource "google_compute_instance_from_template" "primary" {
  advanced_machine_features {
    performance_monitoring_unit = # value needed
  }
}

Resource: google_container_cluster (558 total tests)
Please add an acceptance test which includes these fields. The test should include the following:

resource "google_container_cluster" "primary" {
  node_pool {
    node_config {
      advanced_machine_features {
        performance_monitoring_unit = # value needed
      }
    }
  }
}

Test report

Analytics

Total Tests Passed Skipped Affected
1761 1647 108 6
Affected Service Packages
  • compute
  • container

Learn how VCR tests work


Step 1: Replaying Mode

Action taken

Found 6 affected test(s) by replaying old test recordings. Starting RECORDING based on the most recent commit.

Click here to see the affected tests
  • TestAccComputeInstanceTemplate_performanceMonitoringUnit
  • TestAccComputeInstance_performanceMonitoringUnit
  • TestAccComputeRegionInstanceTemplate_performanceMonitoringUnit
  • TestAccContainerCluster_withAdvancedMachineFeaturesPMU_Standard
  • TestAccContainerCluster_withLoggingConfig
  • TestAccContainerNodePool_withHostMaintenancePolicy

View the replaying VCR build log


Step 2: Recording Mode

Recording Mode Replaying Rerun Test Name
✅ Log TestAccContainerCluster_withAdvancedMachineFeaturesPMU_Standard
❌ Error · Log - TestAccComputeInstanceTemplate_performanceMonitoringUnit
❌ Error · Log - TestAccComputeInstance_performanceMonitoringUnit
❌ Error · Log - TestAccComputeRegionInstanceTemplate_performanceMonitoringUnit
❌ Error · Log - TestAccContainerCluster_withLoggingConfig
❌ Error · Log - TestAccContainerNodePool_withHostMaintenancePolicy

Caution

Issues requiring attention before PR completion

🔴 Initial Recording Failed: Some tests failed during the recording step. See the table above for details.

Please address these issues to complete your PR. If you believe these detections are incorrect or unrelated to your change, please raise the concern with your reviewer.

View the recording VCR build log or the debug logs folder for detailed results.

@Capstan VCR tests complete for 231dbb7!

@Capstan
Capstan force-pushed the fix-compute-perf-mon branch from 231dbb7 to b4eaa08 Compare June 6, 2026 19:20
@modular-magician

modular-magician commented Jun 6, 2026

Copy link
Copy Markdown
Collaborator

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

Diff report

Your PR generated the following diffs in downstream repositories:

Repository Diff Link Changes
google provider View Diff 7 files changed, 25 insertions(+), 24 deletions(-)
google-beta provider View Diff 7 files changed, 25 insertions(+), 24 deletions(-)

Missing test report

Your PR includes resource fields which are not covered by any test.

Resource: google_compute_instance_from_machine_image (20 total tests)
Please add an acceptance test which includes these fields. The test should include the following:

resource "google_compute_instance_from_machine_image" "primary" {
  advanced_machine_features {
    performance_monitoring_unit = # value needed
  }
}

Resource: google_compute_instance_from_template (30 total tests)
Please add an acceptance test which includes these fields. The test should include the following:

resource "google_compute_instance_from_template" "primary" {
  advanced_machine_features {
    performance_monitoring_unit = # value needed
  }
}

Resource: google_container_cluster (558 total tests)
Please add an acceptance test which includes these fields. The test should include the following:

resource "google_container_cluster" "primary" {
  node_pool {
    node_config {
      advanced_machine_features {
        performance_monitoring_unit = # value needed
      }
    }
  }
}

Test report

Analytics

Total Tests Passed Skipped Affected
1761 1648 108 5
Affected Service Packages
  • compute
  • container

Learn how VCR tests work


Step 1: Replaying Mode

Action taken

Found 5 affected test(s) by replaying old test recordings. Starting RECORDING based on the most recent commit.

Click here to see the affected tests
  • TestAccComputeInstanceTemplate_performanceMonitoringUnit
  • TestAccComputeInstance_performanceMonitoringUnit
  • TestAccComputeRegionInstanceTemplate_performanceMonitoringUnit
  • TestAccContainerCluster_withLoggingConfig
  • TestAccContainerNodePool_withHostMaintenancePolicy

View the replaying VCR build log


Step 2: Recording Mode

Recording Mode Replaying Rerun Test Name
✅ Log TestAccComputeInstanceTemplate_performanceMonitoringUnit
✅ Log TestAccComputeInstance_performanceMonitoringUnit
✅ Log TestAccComputeRegionInstanceTemplate_performanceMonitoringUnit
❌ Error · Log - TestAccContainerCluster_withLoggingConfig
❌ Error · Log - TestAccContainerNodePool_withHostMaintenancePolicy

Caution

Issues requiring attention before PR completion

🔴 Initial Recording Failed: Some tests failed during the recording step. See the table above for details.

Please address these issues to complete your PR. If you believe these detections are incorrect or unrelated to your change, please raise the concern with your reviewer.

View the recording VCR build log or the debug logs folder for detailed results.

@Capstan VCR tests complete for b4eaa08!

@Capstan
Capstan marked this pull request as ready for review June 6, 2026 22:40
@github-actions

github-actions Bot commented Jun 6, 2026

Copy link
Copy Markdown

Googlers: For automatic test runs see go/terraform-auto-test-runs.

@malhotrasagar2212, 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.

@Capstan
Capstan force-pushed the fix-compute-perf-mon branch 2 times, most recently from 8ce500e to 0b0b481 Compare June 6, 2026 23:10
@modular-magician

modular-magician commented Jun 6, 2026

Copy link
Copy Markdown
Collaborator

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

Diff report

Your PR generated the following diffs in downstream repositories:

Repository Diff Link Changes
google provider View Diff 8 files changed, 34 insertions(+), 24 deletions(-)
google-beta provider View Diff 8 files changed, 34 insertions(+), 24 deletions(-)

Missing test report

Your PR includes resource fields which are not covered by any test.

Resource: google_compute_instance_from_machine_image (20 total tests)
Please add an acceptance test which includes these fields. The test should include the following:

resource "google_compute_instance_from_machine_image" "primary" {
  advanced_machine_features {
    performance_monitoring_unit = # value needed
  }
}

Resource: google_compute_instance_from_template (30 total tests)
Please add an acceptance test which includes these fields. The test should include the following:

resource "google_compute_instance_from_template" "primary" {
  advanced_machine_features {
    performance_monitoring_unit = # value needed
  }
}

Resource: google_container_cluster (558 total tests)
Please add an acceptance test which includes these fields. The test should include the following:

resource "google_container_cluster" "primary" {
  node_pool {
    node_config {
      advanced_machine_features {
        performance_monitoring_unit = # value needed
      }
    }
  }
}

Test report

Analytics

Total Tests Passed Skipped Affected
1761 1650 108 3
Affected Service Packages
  • compute
  • container

Learn how VCR tests work


Step 1: Replaying Mode

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
  • TestAccComputeRouterPeer_AddMd5AuthenticationKey
  • TestAccContainerCluster_withLoggingConfig
  • TestAccContainerNodePool_withHostMaintenancePolicy

View the replaying VCR build log


Step 2: Recording Mode

Recording Mode Replaying Rerun Test Name
✅ Log TestAccComputeRouterPeer_AddMd5AuthenticationKey
❌ Error · Log - TestAccContainerCluster_withLoggingConfig
❌ Error · Log - TestAccContainerNodePool_withHostMaintenancePolicy

Caution

Issues requiring attention before PR completion

🔴 Initial Recording Failed: Some tests failed during the recording step. See the table above for details.

Please address these issues to complete your PR. If you believe these detections are incorrect or unrelated to your change, please raise the concern with your reviewer.

View the recording VCR build log or the debug logs folder for detailed results.

@Capstan, @malhotrasagar2212 VCR tests complete for 8ce500e!

@modular-magician

modular-magician commented Jun 6, 2026

Copy link
Copy Markdown
Collaborator

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

Diff report

Your PR generated the following diffs in downstream repositories:

Repository Diff Link Changes
google provider View Diff 7 files changed, 25 insertions(+), 24 deletions(-)
google-beta provider View Diff 7 files changed, 25 insertions(+), 24 deletions(-)

Missing test report

Your PR includes resource fields which are not covered by any test.

Resource: google_compute_instance_from_machine_image (20 total tests)
Please add an acceptance test which includes these fields. The test should include the following:

resource "google_compute_instance_from_machine_image" "primary" {
  advanced_machine_features {
    performance_monitoring_unit = # value needed
  }
}

Resource: google_compute_instance_from_template (30 total tests)
Please add an acceptance test which includes these fields. The test should include the following:

resource "google_compute_instance_from_template" "primary" {
  advanced_machine_features {
    performance_monitoring_unit = # value needed
  }
}

Resource: google_container_cluster (558 total tests)
Please add an acceptance test which includes these fields. The test should include the following:

resource "google_container_cluster" "primary" {
  node_pool {
    node_config {
      advanced_machine_features {
        performance_monitoring_unit = # value needed
      }
    }
  }
}

Test report

Analytics

Total Tests Passed Skipped Affected
1761 1651 108 2
Affected Service Packages
  • compute
  • container

Learn how VCR tests work


Step 1: Replaying Mode

Action taken

Found 2 affected test(s) by replaying old test recordings. Starting RECORDING based on the most recent commit.

Click here to see the affected tests
  • TestAccContainerCluster_withLoggingConfig
  • TestAccContainerNodePool_withHostMaintenancePolicy

View the replaying VCR build log


Step 2: Recording Mode

Recording Mode Replaying Rerun Test Name
❌ Error · Log - TestAccContainerCluster_withLoggingConfig
❌ Error · Log - TestAccContainerNodePool_withHostMaintenancePolicy

Caution

Issues requiring attention before PR completion

🔴 Initial Recording Failed: Some tests failed during the recording step. See the table above for details.

Please address these issues to complete your PR. If you believe these detections are incorrect or unrelated to your change, please raise the concern with your reviewer.

View the recording VCR build log or the debug logs folder for detailed results.

@Capstan, @malhotrasagar2212 VCR tests complete for 0b0b481!

@github-actions

Copy link
Copy Markdown

@malhotrasagar2212 This PR has been waiting for review for 3 weekdays. Please take a look! Use the label disable-review-reminders to disable these notifications.

@malhotrasagar2212 malhotrasagar2212 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Hi @Capstan, Thanks for the PR.
Could you please take a look at the failing VCR tests and missing test report.

@Capstan

Capstan commented Jun 18, 2026

Copy link
Copy Markdown
Member Author

Pull #17889 addressed TestAccContainerCluster_withLoggingConfig; I can sync and re-run.

Draft pull #17890 is trying to address TestAccContainerNodePool_withHostMaintenancePolicy, but is unrelated to this test fix -- it's a persistent stockout problem.

@Capstan
Capstan force-pushed the fix-compute-perf-mon branch 2 times, most recently from 4f38528 to 94c74a9 Compare June 18, 2026 01:03
@modular-magician

modular-magician commented Jun 18, 2026

Copy link
Copy Markdown
Collaborator

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

Diff report

Your PR generated the following diffs in downstream repositories:

Repository Diff Link Changes
google provider View Diff 7 files changed, 25 insertions(+), 24 deletions(-)
google-beta provider View Diff 7 files changed, 25 insertions(+), 24 deletions(-)

Missing test report

Your PR includes resource fields which are not covered by any test.

Resource: google_compute_instance_from_machine_image (20 total tests)
Please add an acceptance test which includes these fields. The test should include the following:

resource "google_compute_instance_from_machine_image" "primary" {
  advanced_machine_features {
    performance_monitoring_unit = # value needed
  }
}

Resource: google_compute_instance_from_template (30 total tests)
Please add an acceptance test which includes these fields. The test should include the following:

resource "google_compute_instance_from_template" "primary" {
  advanced_machine_features {
    performance_monitoring_unit = # value needed
  }
}

Resource: google_container_cluster (576 total tests)
Please add an acceptance test which includes these fields. The test should include the following:

resource "google_container_cluster" "primary" {
  node_pool {
    node_config {
      advanced_machine_features {
        performance_monitoring_unit = # value needed
      }
    }
  }
}

Test report

Analytics

Total Tests Passed Skipped Affected
1787 1676 107 4
Affected Service Packages
  • compute
  • container

Learn how VCR tests work


Step 1: Replaying Mode

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
  • TestAccComputeInstance_performanceMonitoringUnit
  • TestAccComputeRegionInstanceTemplate_performanceMonitoringUnit
  • TestAccContainerCluster_regionalWithNodePool
  • TestAccContainerNodePool_withHostMaintenancePolicy

View the replaying VCR build log


Step 2: Recording Mode

Recording Mode Replaying Rerun Test Name
✅ Log TestAccComputeInstance_performanceMonitoringUnit
✅ Log TestAccComputeRegionInstanceTemplate_performanceMonitoringUnit
❌ Error · Log - TestAccContainerCluster_regionalWithNodePool
❌ Error · Log - TestAccContainerNodePool_withHostMaintenancePolicy

Caution

Issues requiring attention before PR completion

🔴 Initial Recording Failed: Some tests failed during the recording step. See the table above for details.

Please address these issues to complete your PR. If you believe these detections are incorrect or unrelated to your change, please raise the concern with your reviewer.

View the recording VCR build log or the debug logs folder for detailed results.

@Capstan, @malhotrasagar2212 VCR tests complete for 4f38528!

@modular-magician

modular-magician commented Jun 18, 2026

Copy link
Copy Markdown
Collaborator

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

Diff report

Your PR generated the following diffs in downstream repositories:

Repository Diff Link Changes
google provider View Diff 7 files changed, 23 insertions(+), 22 deletions(-)
google-beta provider View Diff 7 files changed, 23 insertions(+), 22 deletions(-)

Missing test report

Your PR includes resource fields which are not covered by any test.

Resource: google_compute_instance_from_machine_image (20 total tests)
Please add an acceptance test which includes these fields. The test should include the following:

resource "google_compute_instance_from_machine_image" "primary" {
  advanced_machine_features {
    performance_monitoring_unit = # value needed
  }
}

Resource: google_compute_instance_from_template (30 total tests)
Please add an acceptance test which includes these fields. The test should include the following:

resource "google_compute_instance_from_template" "primary" {
  advanced_machine_features {
    performance_monitoring_unit = # value needed
  }
}

Resource: google_container_cluster (576 total tests)
Please add an acceptance test which includes these fields. The test should include the following:

resource "google_container_cluster" "primary" {
  node_pool {
    node_config {
      advanced_machine_features {
        performance_monitoring_unit = # value needed
      }
    }
  }
}

Test report

Analytics

Total Tests Passed Skipped Affected
1787 1676 107 4
Affected Service Packages
  • compute
  • container

Learn how VCR tests work


Step 1: Replaying Mode

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
  • TestAccComputeInstance_performanceMonitoringUnit
  • TestAccComputeRegionInstanceTemplate_performanceMonitoringUnit
  • TestAccContainerCluster_regionalWithNodePool
  • TestAccContainerNodePool_withHostMaintenancePolicy

View the replaying VCR build log


Step 2: Recording Mode

Recording Mode Replaying Rerun Test Name
✅ Log TestAccComputeInstance_performanceMonitoringUnit
✅ Log TestAccComputeRegionInstanceTemplate_performanceMonitoringUnit
❌ Error · Log - TestAccContainerCluster_regionalWithNodePool
❌ Error · Log - TestAccContainerNodePool_withHostMaintenancePolicy

Caution

Issues requiring attention before PR completion

🔴 Initial Recording Failed: Some tests failed during the recording step. See the table above for details.

Please address these issues to complete your PR. If you believe these detections are incorrect or unrelated to your change, please raise the concern with your reviewer.

View the recording VCR build log or the debug logs folder for detailed results.

@Capstan, @malhotrasagar2212 VCR tests complete for 94c74a9!

…failure

When performance_monitoring_unit is unset in HCL configuration, the Compute Engine API defaults it to 'STANDARD' in remote responses. During VCR replay against older cassettes (where the API returned empty string), acceptance tests fail due to state mismatch.

This commit adds a DiffSuppressFunc for performance_monitoring_unit (suppressing diffs between empty string and 'STANDARD') across Compute Instance, Instance Template, Region Instance Template, and Container Node Config to resolve replay mismatches and restore CI stability.
@Capstan
Capstan force-pushed the fix-compute-perf-mon branch from 94c74a9 to 197391f Compare June 18, 2026 14:04
@Capstan

Capstan commented Jun 18, 2026

Copy link
Copy Markdown
Member Author

TestAccContainerNodePool_withHostMaintenancePolicy's is being tracked in hashicorp/terraform-provider-google#25476, but is persistently failing, and PR #17890 suggests disabling it until quota can be obtained.

@modular-magician

modular-magician commented Jun 18, 2026

Copy link
Copy Markdown
Collaborator

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

Diff report

Your PR generated the following diffs in downstream repositories:

Repository Diff Link Changes
google provider View Diff 7 files changed, 23 insertions(+), 22 deletions(-)
google-beta provider View Diff 7 files changed, 23 insertions(+), 22 deletions(-)

Missing test report

Your PR includes resource fields which are not covered by any test.

Resource: google_compute_instance_from_machine_image (20 total tests)
Please add an acceptance test which includes these fields. The test should include the following:

resource "google_compute_instance_from_machine_image" "primary" {
  advanced_machine_features {
    performance_monitoring_unit = # value needed
  }
}

Resource: google_compute_instance_from_template (30 total tests)
Please add an acceptance test which includes these fields. The test should include the following:

resource "google_compute_instance_from_template" "primary" {
  advanced_machine_features {
    performance_monitoring_unit = # value needed
  }
}

Resource: google_container_cluster (576 total tests)
Please add an acceptance test which includes these fields. The test should include the following:

resource "google_container_cluster" "primary" {
  node_pool {
    node_config {
      advanced_machine_features {
        performance_monitoring_unit = # value needed
      }
    }
  }
}

Test report

Analytics

Total Tests Passed Skipped Affected
1787 1678 107 2
Affected Service Packages
  • compute
  • container

Learn how VCR tests work


Step 1: Replaying Mode

Action taken

Found 2 affected test(s) by replaying old test recordings. Starting RECORDING based on the most recent commit.

Click here to see the affected tests
  • TestAccContainerCluster_regionalWithNodePool
  • TestAccContainerNodePool_withHostMaintenancePolicy

View the replaying VCR build log


Step 2: Recording Mode

Recording Mode Replaying Rerun Test Name
❌ Error · Log - TestAccContainerCluster_regionalWithNodePool
❌ Error · Log - TestAccContainerNodePool_withHostMaintenancePolicy

Caution

Issues requiring attention before PR completion

🔴 Initial Recording Failed: Some tests failed during the recording step. See the table above for details.

Please address these issues to complete your PR. If you believe these detections are incorrect or unrelated to your change, please raise the concern with your reviewer.

View the recording VCR build log or the debug logs folder for detailed results.

@Capstan, @malhotrasagar2212 VCR tests complete for 197391f!

@github-actions

Copy link
Copy Markdown

@malhotrasagar2212 This PR has been waiting for review for 3 weekdays. Please take a look! Use the label disable-review-reminders to disable these notifications.

@malhotrasagar2212 malhotrasagar2212 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

The failing tests and missing test report are not due to the added PR changes. LGTM, Thanks

@malhotrasagar2212
malhotrasagar2212 added this pull request to the merge queue Jun 24, 2026
Merged via the queue into GoogleCloudPlatform:main with commit cd6fb93 Jun 24, 2026
25 of 27 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Failing test(s): TestAccComputeInstance_performanceMonitoringUnit

3 participants