I use console runner (xUnit 2.4.1) to execute set of tests. Some tests should fail in case they need too long to finish, but it seems like Timeout attribute is ignored.
This is my simple test method that should fail:
[Fact(Timeout = 1000)]
public void ShouldTimeout()
{
Thread.Sleep(15000);
}
I execute runner with the option -parallel none in order to avoid undefined behaviour:
xunit.console.exe tests.dll -parallel none -method "Tests.TessClass.ShouldTimeout"
and I also added [assembly: CollectionBehavior(DisableTestParallelization = true)] into my assembly configuration.
The test, however, still finishes successfully with the following output.
xUnit.net Console Runner v2.4.1 (64-bit Desktop .NET 4.5.2, runtime: 4.0.30319.42000)
Discovering: tests
Discovered: tests
Starting: tests
Finished: tests
=== TEST EXECUTION SUMMARY ===
tests Total: 1, Errors: 0, Failed: 0, Skipped: 0, Time: 15,151s
Did I miss something? Is the parallelization still not disabled and therefore Timeout is ignored?