Skip to content

Stabilize WinUI extension E2E startup - #19947

Open
Ella Hathaway (ellahathaway) wants to merge 1 commit into
mainfrom
ellahathaway-fix-vscode-e2e-flake
Open

Stabilize WinUI extension E2E startup#19947
Ella Hathaway (ellahathaway) wants to merge 1 commit into
mainfrom
ellahathaway-fix-vscode-e2e-flake

Conversation

@ellahathaway

@ellahathaway Ella Hathaway (ellahathaway) commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

Description

The Windows winui-debug VS Code extension E2E shard can start Aspire while the C# language server is still loading the generated WinUI project. Both builds then invoke XamlCompiler.exe against the same obj\...\input.json, intermittently causing a sharing violation and leaving the test waiting for a readiness marker that can never be written.

This change opens App.xaml.cs and waits for the C# definition provider to resolve the XAML-generated InitializeComponent method under the project's obj directory before launching Aspire. That semantic barrier confirms Roslyn's design-time XAML pass has completed without replacing the real Aspire build with a prebuild or fixed delay. The synchronization contract is covered by the E2E launch-profile unit test and documented in the extension contributor guide.

Validation:

  • corepack yarn compile-tests
  • corepack yarn compile
  • corepack yarn compile-e2e
  • corepack yarn lint
  • corepack yarn unit-test --run out/test/e2eLaunchProfile.test.js (75 passed)
  • Windows x64 winui-debug PR CI: initial job and repeat job passed. Repeat diagnostics show Roslyn completed the WinUI project load at 20:32:41.631 before Aspire started the AppHost build at 20:32:42.840.

The exact x64 shard cannot complete locally on this Windows ARM64 machine because C# 2.140.9's x64 Roslyn BuildHost fails under emulation with BadImageFormatException; the PR's Windows x64 extension E2E job provides the architecture-matching verification.

Fixes #19935

Checklist

  • Is this feature complete?
    • Yes. Ready to ship.
    • No. Follow-up changes expected.
  • Are you including unit tests for the changes and scenario tests if relevant?
    • Yes
    • No
  • Did you add public API?
    • Yes
      • If yes, did you have an API Review for it?
        • Yes
        • No
      • Did you add <remarks /> and <code /> elements on your triple slash comments?
        • Yes
        • No
    • No
  • Does the change make any security assumptions or guarantees?
    • Yes
      • If yes, have you done a threat model and had a security review?
        • Yes
        • No
    • No

This fix was generated using the fix-flaky-test skill.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 8ed7e984-c8a0-4c23-8947-fede1e23b15d
Copilot AI balanced review requested due to automatic review settings September 4, 2026 19:46
@github-actions

github-actions Bot commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

🚀 Dogfood this PR with:

⚠️ WARNING: Do not do this without first carefully reviewing the code of this PR to satisfy yourself it is safe.

curl -fsSL https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 19947

Or

  • Run remotely in PowerShell:
iex "& { $(irm https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.ps1) } 19947"

@github-actions

github-actions Bot commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

Tests selector

0 / 99 PR test projects · 2 PR jobs · 0 advisory-only targets, from 2 changed files.

Selected PR test projects (0 / 99)

none — no PR-gated .NET test projects run for this change.

Selected PR jobs (2)

extension-e2e, extension-unit

Advisory workflow impact (0)

none


How these were chosen — grouped by what changed

Job reasons

Job Triggered by
extension-e2e extension/src/test-e2e/winUiDebug.e2e.test.ts, extension/src/test/e2eLaunchProfile.test.ts
extension-unit extension/src/test-e2e/winUiDebug.e2e.test.ts, extension/src/test/e2eLaunchProfile.test.ts

Selection computed for commit 1ef1e8f.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟢 Approval recommended

The focused synchronization logic, regression coverage, and documentation are consistent and complete.

Pull request overview

Stabilizes WinUI extension E2E startup by waiting for Roslyn’s generated XAML definition before launching Aspire.

Changes:

  • Adds a semantic C# project-load barrier.
  • Verifies startup ordering through source-contract tests.
  • Documents the WinUI synchronization requirement.
File summaries
File Description
extension/src/test/e2eLaunchProfile.test.ts Verifies synchronization ordering.
extension/src/test-e2e/winUiDebug.e2e.test.ts Waits for generated InitializeComponent.
extension/CONTRIBUTING.md Documents the race and mitigation.
Review details
  • Files reviewed: 3/3 changed files
  • Comments generated: 0
  • Review effort level: Balanced

💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.

@ellahathaway Ella Hathaway (ellahathaway) changed the title [automated] Stabilize WinUI extension E2E startup Stabilize WinUI extension E2E startup Sep 4, 2026
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.

[CI Failure] Flaky: VS Code extension E2E (Windows, winui-debug) shard fails with generic exit code 1, unrelated to PR changes

2 participants