Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mark timeout tests as timed out instead of failed #1707

Closed
dotMorten opened this issue Jul 30, 2018 · 2 comments
Closed

Mark timeout tests as timed out instead of failed #1707

dotMorten opened this issue Jul 30, 2018 · 2 comments

Comments

@dotMorten
Copy link
Contributor

dotMorten commented Jul 30, 2018

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

@dotMorten dotMorten changed the title Mark timeout-out tests as timed out instead of errored Mark timeout tests as timed out instead of errored Jul 30, 2018
@dotMorten dotMorten changed the title Mark timeout tests as timed out instead of errored Mark timeout tests as timed out instead of failed Jul 30, 2018
@Sanan07 Sanan07 self-assigned this Feb 10, 2021
@Sanan07
Copy link
Contributor

Sanan07 commented Feb 10, 2021

Currently when we have TimeOut[1000] attribute and test timeouts we get error message in console "Test 'TestMethod1' exceeded execution timeout period.", but in trx logger we see that test marked as ResultSummary outcome as "Failed", but in Counter we have failed="1", instead of timeout="1"
Actual :

<ResultSummary outcome="Failed">
   <Counters total="1" executed="1" passed="0" failed="1" error="0" timeout="0" aborted="0" inconclusive="0" passedButRunAborted="0" notRunnable="0" notExecuted="0" disconnected="0" warning="0" completed="0" inProgress="0" pending="0" />
</ResultSummary>

Expected:

<ResultSummary outcome="Failed">
   <Counters total="1" executed="1" passed="0" failed="0" error="0" timeout="1" aborted="0" inconclusive="0" passedButRunAborted="0" notRunnable="0" notExecuted="0" disconnected="0" warning="0" completed="0" inProgress="0" pending="0" />
</ResultSummary>

Changes : In Counters tag timeout set to "1" as test actually timeouted.

@Sanan07 Sanan07 added the sprint label Feb 11, 2021
@Sanan07 Sanan07 removed their assignment Dec 14, 2021
@Evangelink Evangelink added needs-triage This item should be discussed in the next triage meeting. and removed sprint labels Aug 3, 2022
@Evangelink Evangelink removed the needs-triage This item should be discussed in the next triage meeting. label Nov 30, 2022
@nohwnd
Copy link
Member

nohwnd commented Jul 9, 2024

This is a new feature and won't be implemented, we are focusing on adding new features to Testing.Platform instead. https://aka.ms/testingplatform

@nohwnd nohwnd closed this as not planned Won't fix, can't repro, duplicate, stale Jul 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants