title: Timeout in C# UT Visual Studio does not work
body: <p>I have problem with Timeout attribute (<a href="https://docs.microsoft.com/en-us/dotnet/api/microsoft.visualstudio.testtools.unittesting.timeoutattribute?view=visualstudiosdk-2022" rel="nofollow noreferrer">MSDN doc</a>) for tests in C# in Visual Studio 2019.</p>
  <p>For some reasons sometimes it does not end test if declared timeout is reached - for example: test is set to timeout after 2h (in milliseconds) and i found out that after 2 days is still stuck.</p>
  <p>Tests are using selenium and web driver to walk on some pages. In some (yet unknown) cases code is stuck and I would expect that timeout will occur and stop such tests...</p>
  <p>In our code we have 2 types of test declarations:</p>
  <pre><code>using Microsoft.VisualStudio.TestTools.UnitTesting;
  [TestMethod]
  [Timeout(7200000)]
  public void Test1() {...}
  
  [TestMethod]
  [Timeout(7200000)]
  public Task Test2() {...}
  </code></pre>
  <p>In some test we are using also <code>[DataSource]</code> attribute to feed test - I am aware that timeout will work for all tests combined in that case.</p>
  <p>Of course I will try to find the real reason why test is stuck on some methods, but still I expect timeout to work.</p>
  <p>Any idea what the reason could be that timeout is not working?</p>