Skip to content

Commit 70f7c3b

Browse files
committed
Flaky test investigation
1 parent a9e46d6 commit 70f7c3b

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/Adapter/MSTest.TestAdapter/Helpers/FixtureMethodRunner.cs

+8-1
Original file line numberDiff line numberDiff line change
@@ -174,8 +174,15 @@ internal static class FixtureMethodRunner
174174
UnitTestOutcome.Timeout,
175175
string.Format(CultureInfo.InvariantCulture, methodCanceledMessageFormat, methodInfo.DeclaringType!.FullName, methodInfo.Name));
176176
}
177-
catch (Exception)
177+
catch (Exception ex)
178178
{
179+
if (ex is AggregateException aggregateEx && aggregateEx.InnerExceptions.OfType<TaskCanceledException>().Any(tce => tce.CancellationToken == cancellationTokenSource.Token))
180+
{
181+
return new(
182+
UnitTestOutcome.Timeout,
183+
"Are we going to hit this??");
184+
}
185+
179186
// We throw the real exception to have the original stack trace to elaborate up the chain.
180187
if (realException is not null)
181188
{

0 commit comments

Comments
 (0)