Description
Description
If you add a [Timeout(xxx)]
attribute to a test, and it times out, the test is shown as failed with a System.Timeout exception. There's no way to tell if the test actually timed out due to this attribute, or whether the test itself threw this exception unexpectantly deeper down below the test-runner.
The set of TestOutcome
values declared in the TRX Schema actually lists a Timeout
option, however it appears this is never used, and the Failed status is used instead.
Instead I believe the test runner should declare a private timeout exception type to throw, and when the test result is set, it's checked if this is the exception that was thrown, and instead set the status to timeout, rather than setting it to failed with a useless stacktrace.
Steps to reproduce
Create a unit test with a timeout attribute, make it run longer than the timeout setting.
Expected behavior
Test should be marked timed out in Test Explorer. TRX report should flag it as timed out instead of Failed.
Actual behavior
Test is flagged as failed.