Async test methods never complete

VS2026 v18.0.1
R# 2025.3.0.1
MSTest.Sdk/4.0.2

I have a number of async tests in my test project. For example:

[TestClass]
public class AsyncCommandExtensionsTests
{
    public TestContext TestContext { get; set; }
    
    [TestMethod]
    public async Task SelectOneAsyncTest()
    {
        using var connection = new SqlConnection(Constants.ConnectionString);
        using var command = new SqlCommand("SELECT @@VERSION", connection);

        var record = await command.SelectOneAsync(TestContext.CancellationToken);
        Assert.IsNotNull(record);

        string version = record.Field<string>(0);
        Assert.IsFalse(string.IsNullOrWhiteSpace(version));
    }
}

If I run the test through the Visual Studio unit test explorer, it works perfectly.

If I run the test through the R# test runner, or the dotCover “continuous testing” session, it never completes. I have tried leaving it for over an hour, and the test is still “running”.

If I debug the test, it hangs on the first “await” call.

My test project multi-targets .NET Framework 4.8 and .NET 10.0; as far as I can tell, the problem only seems to affect the .NET Framework version of the tests.

<Project Sdk="MSTest.Sdk/4.0.2">
	<PropertyGroup>
		<TargetFrameworks>net48;net10.0</TargetFrameworks>
		<LangVersion>14.0</LangVersion>
		<WarningLevel>9999</WarningLevel>
		<IsPackable>false</IsPackable>
	</PropertyGroup>

	<ItemGroup>
		<ProjectReference Include="..\NBS.Core.Data\NBS.Core.Data.csproj" />
	</ItemGroup>
</Project>

Is this a known bug?

0
6 comments

Hello Richard,

 

Thanks for contacting JetBrains support! 

Regarding this issue, I've tried with the same MSTest SDK but unable to reproduce the issue on the latest ReSharper (2025.3.0.3). Could you please upgrade ReSharper and verify if the issue persists? 

If the issue continues, could you please upload a complete sample project that reproduces the issue? You can upload it to the Upload Service and share the Upload ID.

Thanks,

Tom

0

I'm already on 2025.3.0.3: 253.0.20251124.223441 built on 2025-11-24

Looks like it may be related to continuous testing. I've just created a simple test project with one async test. Running it directly works. After adding it to the continuous testing, it never returns; the test just sits on “running” forever. 

Attempting to stop the session also never completes.

Upload id: 2025_12_01_242Pnb5BzYaHj4AZN6A5Ek (file: TestReSharperAsyncTests.zip)

0

Richard Deeming Thanks for the additional details. I have tried again with your sample, but still no success:

(Test failure is expected as I don't have SQL Server installed)

Continuous testing is dependent on dotCover, which has a similar issue tracked under: DCVR-13247 Test Coverage Hangs Indefinitely, Process Cannot Be Terminated

Could you please downgrade to 2025.2.0.1 or an earlier version, and verify if the issue persists? If the issue disappears, then it should be the same issue. 

If the issue persists, please provide the information below to help us escalate this issue properly:

  • Verify if the issue continues with even more simplified code:
        [TestMethod]
        public async Task SelectOneAsyncTest()
        {
            var obj = new object();
            await Task.Delay(1000);
            Assert.IsNotNull(obj);
        }
  • Collect ReSharper logs:
  1. Follow SUPPORT-A-370 How to collect ReSharper log file with a specific Trace scenario to enable Verbose Logging and Unit Testing tracing
  2. Open (Extensions |) ReSharper | Options | Tools | Unit Testing | Test Runner;
  3. Change Logging level to Trace;
  4. Reproduce the issue
  5. Zip all the files from the log folder ( %temp%\JetLogs by default)
  6. Revert all the log configurations made above.

We will investigate this further once the information is received. Thanks again for your time and effort to help us diagnose this issue. 

 

Regards,

Tom

0

It looks like that issue might be related. But I don't get the dialog box; I just get the test session running indefinitely, and the “stop” button not working. The only way I can stop the test is to terminate the “ReSharperTestRunner64” process.

With 2025.3.0.3, the issue persists even with the simplified code. I've uploaded the log files in case it helps:

Upload id: 2025_12_03_PAtAkM3JiXHJGX6Hiu33Fu (file: JetLogs.zip)

0

When I use the MsTest resharper version, when using Debug, the await program will get stuck! There is no problem in operation and cannot be debugged.

0

2649340134 This should be a different issue. The original issue only occurs when running continuous tests. I've tried this on my end, but not able to reproduce it. For better tracking, I recommend you submit an issue on our issue tracker with the following details:

  • The issue occurs only when debugging it, and no issues when running without debugging, right?
  • Collect Rider logs:
  1. Go to Help | Diagnostic tools | Choose Trace Scenarios;
  2. Enable the trace scenario for Debugger;
  3. Reproduce the issue;
  4. Collect the full log bundle via Help | Collect Logs and Diagnostic Data;
  5. Disable the trace scenarios enabled;
  6. Attach the resulting log bundle to this ticket or upload it to our server and share the ID.

 

0

Please sign in to leave a comment.