Skip to content

Running tests targeting net6.0 are stuck #3295

@Evangelink

Description

@Evangelink

tests get stuck with dotnet test and the new dotnet test integration.

The InvokeTestPlatformTask is not completing, and it cannot be cancelled.

image

# file global.json
{
  "sdk": {
    "version": "6.0.128"
  }
}
<!-- file mstest114.csproj -->
<Project Sdk="Microsoft.NET.Sdk">

  <PropertyGroup>
    <TargetFramework>net6.0</TargetFramework>
    <LangVersion>latest</LangVersion>
    <ImplicitUsings>enable</ImplicitUsings>
    <Nullable>enable</Nullable>

    <IsPackable>false</IsPackable>
    <IsTestProject>true</IsTestProject>
    <EnableMSTestRunner>true</EnableMSTestRunner>
     <!-- Add this to your project file. -->
    <TestingPlatformDotnetTestSupport>true</TestingPlatformDotnetTestSupport>

    <OutputType>Exe</OutputType>
  </PropertyGroup>

  <ItemGroup>
    <PackageReference Include="MSTest" Version="3.2.0" />
    <PackageReference Include="Microsoft.Testing.Extensions.CodeCoverage" Version="17.10.1" />
  </ItemGroup>

  <ItemGroup>
    <Using Include="Microsoft.VisualStudio.TestTools.UnitTesting" />
  </ItemGroup>

</Project>
// file MSTestSettings.cs
[assembly: Parallelize(Scope = ExecutionScope.MethodLevel)]
// file UnitTest1.cs
namespace mstest114;

[TestClass]
public class UnitTest1
{
    [TestMethod]
    public void TestMethod1()
    {
    }
}

Originally posted by @nohwnd in https://github.com/microsoft/testanywhere/issues/2016

Metadata

Metadata

Labels

Area: MTPBelongs to the Microsoft.Testing.Platform core library

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions