question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

VSTest task should support an option to automatically rerun failed tests.

See original GitHub issue

Issue Description

There are cases where functional tests or integration tests are not 100% reliable due to various reasons, including partner issues, storage account issues or some rare test race conditions issues. Investing time in fixing unreliable tests sometimes is not a short term goal, but disable them is not a good option either because those tests are still valuable in identifying real breaking changes.

Those flaky tests mostly succeeded after a retry run, it will be nice for VSTest task to enable this option to automatically rerun failed tests up to X times.

What I’m thinking how it would work:

  • VSTest task runs vstest once

Continue the following retry X times

  • Parse the trx result and identify failed test names
  • Rerun vstest with filter set to those failed test names only(and any filters that’s specified by the user)

The question left is how to represent the test results, ideally we would want to show that individual tests failed and succeeded on those runs, but at the end signify success when all tests run succeeded after reruns.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:8 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
BrianMouncercommented, May 24, 2019

@PBoraMSFT

We use YAML builds, and call VSTest.console.exe directly in some cases so that we can change test runners or run inside a docker container. I can’t figure out what “VSTest Task@2” passes through to VSTest.console.exe when using “rerunFailedTests: true”.

Do you know where this is documented, or can you just give me the information? I don’t think it is exposed on the command line, and I am thinking it is something you need to pass in via the .RunSettings file???

0reactions
TimHolzherrcommented, Sep 24, 2021

@BrianMouncer I have the exact same question 😀. Have you found an answer in the meantime?

Read more comments on GitHub >

github_iconTop Results From Across the Web

VSTest@2 - Visual Studio Test v2 task - Microsoft Learn
Use this task to run unit and functional tests (Selenium, Appium, Coded UI test, etc.) using the Visual Studio Test (VSTest) runner. You...
Read more >
Rerun failed tests in VSTest task using YAML - Stack Overflow
Hi @silver, you can try using the MSBuild task to build the whole solution. Then use the VSTest task to execute the tests....
Read more >
Problem with argument: rerun in task vstest
I have a problem with the rerun argument in the vstest task . When the test fails and tries start again test for...
Read more >
MSTest Rerun Failed Tests Through MSTest.exe Wrapper ...
If there are still any failed tests and the previously mentioned conditions are again met, a new rerun will be conducted. If you...
Read more >
New cool feature of VSTS to limit impact of erratic tests
Thanks to this feature, the build can automatically re-run failed tests, completely eliminating the problem of erratic tests, and showing as ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found