Skip to content

Fix async TestInitialize/TestCleanup causing COMException in WinUI UITestMethod by @Copilot in #8119 (backport to rel/4.2)#8147

Closed
nohwnd-bot wants to merge 9 commits into
microsoft:rel/4.2from
nohwnd-bot:backport/8119/to/rel/4.2
Closed

Fix async TestInitialize/TestCleanup causing COMException in WinUI UITestMethod by @Copilot in #8119 (backport to rel/4.2)#8147
nohwnd-bot wants to merge 9 commits into
microsoft:rel/4.2from
nohwnd-bot:backport/8119/to/rel/4.2

Conversation

@nohwnd-bot
Copy link
Copy Markdown

Backport of #8119 to rel/4.2

/cc @Evangelink @copilot

Copilot AI and others added 9 commits May 12, 2026 07:27
The test was using _testMethodInfo which has a 1-hour timeout set,
causing IsTimeoutSet to be true. This routes through
ExecuteInternalWithTimeoutAsync's non-cooperative path which runs
ExecuteInternalAsync on a separate thread pool thread where
SynchronizationContext.Current is null.

Create a local TestMethodInfo without a timeout so the test goes
through the direct ExecuteInternalAsync path on the SC's thread,
which is the code path the production fix targets.
…handling, TestCleanup test, and fix comment accuracy

Co-authored-by: Evangelink <[email protected]>
@Evangelink Evangelink closed this May 12, 2026
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