test: make Windows log extraction best-effort in cleanup#8433
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates the Windows E2E cleanup log extraction flow to be best-effort so that cleanup failures (e.g., VM deallocated / provisioning never completed) don’t register as additional test failures and obscure the real failure signal.
Changes:
- In
extractLogsFromVMWindows, replacerequire.NoErroron RunCommand initiation/polling withLogf+ earlyreturn. - Minor formatting tweak (blank line) in the same function for readability.
timmy-wright
approved these changes
Apr 29, 2026
836f01b to
751be52
Compare
751be52 to
e6813ab
Compare
|
There was an error handling pipeline event e6ecd9c4-aa93-4455-90c0-9dcd97d0fa70. |
e6813ab to
fd643e2
Compare
fd643e2 to
f896c02
Compare
f896c02 to
afb00b6
Compare
Comment on lines
703
to
705
| PublishingProfile: &armcompute.GalleryImageVersionPublishingProfile{ | ||
| ReplicationMode: to.Ptr(armcompute.ReplicationModeShallow), | ||
| ReplicationMode: to.Ptr(armcompute.ReplicationModeFull), | ||
| TargetRegions: []*armcompute.TargetRegion{ |
There was a problem hiding this comment.
This PR changes SIG image version ReplicationMode from Shallow to Full, but the PR description/title only discuss making Windows log extraction best-effort. Please either revert this unrelated behavior change or update the PR description with the rationale (and consider the test/runtime impact, since Full replication can increase image version creation time/cost).
extractLogsFromVMWindows used require.NoError for RunCommand operations, which caused cleanup failures to register as additional test failures. When a VHD caching test fails (e.g. OSProvisioningTimedOut), the cleanup tries to collect logs from a VM that may be deallocated or never provisioned, producing 409 Conflict or OSProvisioningTimedOut errors that obscure the real failure. Replace require.NoError with Logf + return to match the existing Linux log extraction pattern (vmss.go:692-694), making Windows log collection best-effort rather than test-failing. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
afb00b6 to
31e8cf8
Compare
timmy-wright
approved these changes
May 3, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
extractLogsFromVMWindowsusedrequire.NoErrorfor RunCommand operations during test cleanup. When a test fails and the VM is deallocated or never provisioned, RunCommand returns errors (409 Conflict, OSProvisioningTimedOut) that register as additional test failures, inflating the failure count and obscuring the real root cause.Example: build 162224450 reported 3 failures for
Test_Windows2022_VHDCaching, but only 1 was the actual failure (Stage 2 VM provisioning timeout). The other 2 were cleanup trying to RunCommand on deallocated/unprovisioned VMs.Fix
Replace
require.NoErrorwithLogf+returninextractLogsFromVMWindows, matching the existing Linux log extraction pattern (vmss.go:692-694) which already handles errors gracefully.Impact