Skip to content

Conversation

@Youssef1313
Copy link
Member

@Youssef1313 Youssef1313 commented Feb 9, 2026

Reverts #7313

Tests are still flaky.

failed CancellationAsyncWithReturnValue_ObserveException_Succeeds (10s 154ms)
  from D:\a\_work\1\s\artifacts\bin\Microsoft.Testing.Platform.UnitTests\Debug\net462\Microsoft.Testing.Platform.UnitTests.exe (net48|x64)
  Assert.ThrowsAsync failed. Expected exception type:<System.OperationCanceledException>. Actual exception type:<System.InvalidOperationException>. 'action' expression: 'async ()
              => await Task.Run(async () =>
              {
                  await Task.Delay(TimeSpan.FromSeconds(5), TestContext.CancellationToken);
                  try
                  {
                      return 2;
                  }
                  finally
                  {
                      waitException.Set();
  #pragma warning disable CA2219 // Do not raise exceptions in finally clauses
                      throw new InvalidOperationException();
  #pragma warning restore CA2219 // Do not raise exceptions in finally clauses
                  }
              }).WithCancellationAsync(token)'.
    at Microsoft.VisualStudio.TestTools.UnitTesting.Assert.ThrowAssertFailed(String assertionName, String message)
    at Microsoft.VisualStudio.TestTools.UnitTesting.Assert.<>c__DisplayClass244_1`1.<IsThrowsAsyncFailingAsync>b__1(String userMessage)
    at Microsoft.VisualStudio.TestTools.UnitTesting.Assert.<ThrowsExceptionAsync>d__242`1.MoveNext()
    --- End of stack trace from previous location where exception was thrown ---
    at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
    at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
    at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
    at Microsoft.Testing.Platform.UnitTests.TaskExtensionsTests.<CancellationAsyncWithReturnValue_ObserveException_Succeeds>d__12.MoveNext()
    --- End of stack trace from previous location where exception was thrown ---
    at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
    at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
    at Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.Execution.TestMethodInfo.<ExecuteInternalAsync>d__50.MoveNext()

@Evangelink
Copy link
Member

That was worth trying :) now we have to try and find another reason for the flakiness.

@Evangelink Evangelink enabled auto-merge February 9, 2026 08:40
@Evangelink Evangelink merged commit a12533a into main Feb 9, 2026
11 checks passed
@Evangelink Evangelink deleted the revert-7313-dev/amauryleve/flaky branch February 9, 2026 08:40
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.

2 participants