We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 87de9d4 commit 506c44aCopy full SHA for 506c44a
src/dotnetCampus.UITest.WPF/UITestMethodProxy.cs
@@ -22,7 +22,12 @@ private protected override TestResult InvokeCore(ITestCase testCase)
22
{
23
var task = Application.Current.Dispatcher.Invoke(async () =>
24
25
- return await contractTestCase.ExecuteAsync();
+ var result = await contractTestCase.ExecuteAsync()
26
+ // 如果在执行过程,应用退出了,那在没有加上 ConfigureAwait 设置为 false 那将需要调度回 UI 线程,才能返回
27
+ // 由于应用退出了,也就是 UI 线程不会调度的任务
28
+ // 因此不会返回,单元测试将会卡住
29
+ .ConfigureAwait(false);
30
+ return result;
31
});
32
33
return task.Result;
0 commit comments