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?
Please sign in to leave a comment.
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
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)
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:
(Extensions |) ReSharper | Options | Tools | Unit Testing | Test Runner;Logging levelto Trace;%temp%\JetLogsby default)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
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)
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.
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: