Skip to content

compute: fix TestAccComputeInstanceFromMachineImage_diffProject - #18826

Draft
SirGitsalot wants to merge 1 commit into
GoogleCloudPlatform:mainfrom
SirGitsalot:fix-compute-instance-from-machine-image-diff-project
Draft

compute: fix TestAccComputeInstanceFromMachineImage_diffProject#18826
SirGitsalot wants to merge 1 commit into
GoogleCloudPlatform:mainfrom
SirGitsalot:fix-compute-instance-from-machine-image-diff-project

Conversation

@SirGitsalot

@SirGitsalot SirGitsalot commented Aug 28, 2026

Copy link
Copy Markdown
Member

Fixes nightly acceptance test failure for TestAccComputeInstanceFromMachineImage_diffProject.

Fixes hashicorp/terraform-provider-google#26363

Root Cause & Fix

The test creates a new GCP project (google_project.project) and provisions a google_compute_instance.vm inside it. However, newly created projects may not have a default VPC network pre-provisioned. Attempting to create the VM using network = "default" causes API 400 errors (The referenced network resource cannot be found).

This fix explicitly creates a google_compute_network.net in the newly created project with auto_create_subnetworks = true and attaches google_compute_instance.vm to google_compute_network.net.self_link, allowing the cross-project instance creation from machine image to succeed cleanly without relying on an unprovisioned default network in the secondary project.

@modular-magician

modular-magician commented Aug 28, 2026

Copy link
Copy Markdown
Collaborator

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

Diff report

Your PR generated the following diffs in downstream repositories:

Repository Diff Link Changes
google-beta provider View Diff 1 file changed, 4 insertions(+)

Test report

Analytics

Total Tests Passed Skipped Affected
1559 1462 95 2
Affected Service Packages
  • compute

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
  • TestAccComputeInstanceFromMachineImage_diffProject
  • TestAccComputeSecurityPolicy_withPreconfiguredWafConfig

View the replaying VCR build log


Step 2: Recording Mode

Recording Mode Replaying Rerun Test Name
❌ Error · Log - TestAccComputeInstanceFromMachineImage_diffProject
❌ Error · Log - TestAccComputeSecurityPolicy_withPreconfiguredWafConfig

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.

@SirGitsalot VCR tests complete for 8335352!

@SirGitsalot
SirGitsalot force-pushed the fix-compute-instance-from-machine-image-diff-project branch from 8335352 to 83c6637 Compare August 28, 2026 19:40
@modular-magician

modular-magician commented Aug 28, 2026

Copy link
Copy Markdown
Collaborator

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

Diff report

Your PR generated the following diffs in downstream repositories:

Repository Diff Link Changes
google-beta provider View Diff 1 file changed, 13 insertions(+), 2 deletions(-)

Test report

Analytics

Total Tests Passed Skipped Affected
1559 1462 95 2
Affected Service Packages
  • compute

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
  • TestAccComputeInstanceFromMachineImage_diffProject
  • TestAccComputeSecurityPolicy_withPreconfiguredWafConfig

View the replaying VCR build log


Step 2: Recording Mode

Recording Mode Replaying Rerun Test Name
✅ Log TestAccComputeInstanceFromMachineImage_diffProject
❌ Error · Log - TestAccComputeSecurityPolicy_withPreconfiguredWafConfig

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.

@SirGitsalot VCR tests complete for 83c6637!

@modular-magician

modular-magician commented Aug 28, 2026

Copy link
Copy Markdown
Collaborator

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

Diff report

Your PR generated the following diffs in downstream repositories:

Repository Diff Link Changes
google-beta provider View Diff 1 file changed, 10 insertions(+), 2 deletions(-)

Test report

Analytics

Total Tests Passed Skipped Affected
1559 1462 95 2
Affected Service Packages
  • compute

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
  • TestAccComputeInstanceFromMachineImage_diffProject
  • TestAccComputeSecurityPolicy_withPreconfiguredWafConfig

View the replaying VCR build log


Step 2: Recording Mode

Recording Mode Replaying Rerun Test Name
❌ Error · Log - TestAccComputeInstanceFromMachineImage_diffProject
❌ Error · Log - TestAccComputeSecurityPolicy_withPreconfiguredWafConfig

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.

@SirGitsalot VCR tests complete for cde23ca!

@SirGitsalot
SirGitsalot force-pushed the fix-compute-instance-from-machine-image-diff-project branch from cde23ca to ffdd4bf Compare August 28, 2026 23:30
@modular-magician

modular-magician commented Aug 28, 2026

Copy link
Copy Markdown
Collaborator

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

Diff report

Your PR generated the following diffs in downstream repositories:

Repository Diff Link Changes
google-beta provider View Diff 1 file changed, 10 insertions(+), 2 deletions(-)

Test report

Analytics

Total Tests Passed Skipped Affected
1559 1462 95 2
Affected Service Packages
  • compute

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
  • TestAccComputeInstanceFromMachineImage_diffProject
  • TestAccComputeSecurityPolicy_withPreconfiguredWafConfig

View the replaying VCR build log


Step 2: Recording Mode

Recording Mode Replaying Rerun Test Name
❌ Error · Log - TestAccComputeInstanceFromMachineImage_diffProject
❌ Error · Log - TestAccComputeSecurityPolicy_withPreconfiguredWafConfig

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.

@SirGitsalot VCR tests complete for ffdd4bf!

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): TestAccComputeInstanceFromMachineImage_diffProject

3 participants