Skip to content

test: make Windows log extraction best-effort in cleanup#8433

Merged
r2k1 merged 1 commit intomainfrom
fix/windows-e2e-log-extraction-cleanup
May 4, 2026
Merged

test: make Windows log extraction best-effort in cleanup#8433
r2k1 merged 1 commit intomainfrom
fix/windows-e2e-log-extraction-cleanup

Conversation

@r2k1
Copy link
Copy Markdown
Contributor

@r2k1 r2k1 commented Apr 29, 2026

Problem

extractLogsFromVMWindows used require.NoError for 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.NoError with Logf + return in extractLogsFromVMWindows, matching the existing Linux log extraction pattern (vmss.go:692-694) which already handles errors gracefully.

Impact

  • Log collection failures during cleanup no longer fail the test
  • Real test failures are no longer obscured by cleanup noise
  • No behavior change for successful log collection paths

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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, replace require.NoError on RunCommand initiation/polling with Logf + early return.
  • Minor formatting tweak (blank line) in the same function for readability.

@r2k1 r2k1 enabled auto-merge (squash) April 29, 2026 22:31
@r2k1 r2k1 changed the title fix(e2e): make Windows log extraction best-effort in cleanup test: make Windows log extraction best-effort in cleanup Apr 29, 2026
@r2k1 r2k1 force-pushed the fix/windows-e2e-log-extraction-cleanup branch from 836f01b to 751be52 Compare April 29, 2026 23:07
Copilot AI review requested due to automatic review settings April 30, 2026 01:44
@r2k1 r2k1 force-pushed the fix/windows-e2e-log-extraction-cleanup branch from 751be52 to e6813ab Compare April 30, 2026 01:44
@azure-pipelines
Copy link
Copy Markdown

There was an error handling pipeline event e6ecd9c4-aa93-4455-90c0-9dcd97d0fa70.

@r2k1 r2k1 force-pushed the fix/windows-e2e-log-extraction-cleanup branch from e6813ab to fd643e2 Compare April 30, 2026 01:46
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.

@r2k1 r2k1 force-pushed the fix/windows-e2e-log-extraction-cleanup branch from fd643e2 to f896c02 Compare April 30, 2026 01:46
Copilot AI review requested due to automatic review settings April 30, 2026 01:48
@r2k1 r2k1 force-pushed the fix/windows-e2e-log-extraction-cleanup branch from f896c02 to afb00b6 Compare April 30, 2026 01:48
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

Comment thread e2e/test_helpers.go
Comment on lines 703 to 705
PublishingProfile: &armcompute.GalleryImageVersionPublishingProfile{
ReplicationMode: to.Ptr(armcompute.ReplicationModeShallow),
ReplicationMode: to.Ptr(armcompute.ReplicationModeFull),
TargetRegions: []*armcompute.TargetRegion{
Copy link

Copilot AI Apr 30, 2026

Choose a reason for hiding this comment

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

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).

Copilot uses AI. Check for mistakes.
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>
@r2k1 r2k1 force-pushed the fix/windows-e2e-log-extraction-cleanup branch from afb00b6 to 31e8cf8 Compare May 3, 2026 19:35
@r2k1 r2k1 disabled auto-merge May 4, 2026 20:54
@r2k1 r2k1 merged commit bb5d230 into main May 4, 2026
27 of 32 checks passed
@r2k1 r2k1 deleted the fix/windows-e2e-log-extraction-cleanup branch May 4, 2026 20:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants