-
Notifications
You must be signed in to change notification settings - Fork 289
Open
Labels
Description
Describe the bug
When using the --hangdump-timeout option, the value is considered for the entire test run on macOS. I would expect --hangdump-timeout to be the equivalent of --blame-hang-timeout, which is per-test. It is per-test on Windows.
Steps To Reproduce
- Create an xunit v3 test project
dotnet new install xunit.v3.templates dotnet new xunit3 -o xunit-test - Add a reference to
Microsoft.Testing.Extensions.HangDump - Add the following test methods:
[Fact] public void Test1() => Thread.Sleep(2000); [Fact] public void Test2() => Thread.Sleep(2000);
- Build and run the tests, specifying 3s as the timeout:
xunit3-test --hangdump --hangdump-timeout 3s --no-progress --output Detailed
Expected behavior
The --hangdump-timeout of 3s is per-test and the test run does not hit the timeout. This is the case when running on Windows.
passed xunit3_test.UnitTest1.Test1 (2s 010ms)
passed xunit3_test.UnitTest1.Test2 (2s 001ms)
Actual behavior
The --hangdump-timeout of 3s appears to be for the entire test run, so the run hits the timeout and fails. This happens on macOS, but not Windows.
passed xunit3_test.UnitTest1.Test1 (2s 011ms)
Hang dump timeout of '00:00:03' expired
Dumping process 52649 - xunit3-test
The following tests were still running when dump was taken (format: [<time-elapsed-since-start>] <name>):
[00:00:01] xunit3_test.UnitTest1.Test2
Additional context
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="18.0.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="3.1.5" />I have tried this with both MTP v2:
<PackageReference Include="xunit.v3.mtp-v2" Version="3.2.1" />
<PackageReference Include="Microsoft.Testing.Extensions.HangDump" Version="2.0.2" />And v1:
<PackageReference Include="xunit.v3" Version="3.2.1" />
<PackageReference Include="Microsoft.Testing.Extensions.HangDump" Version="1.9.1" />