Skip to content

Mark timeout tests as timed out instead of failed #1707

Closed as not planned
Closed as not planned
@dotMorten

Description

@dotMorten

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.

AB#1277751

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions