-
Notifications
You must be signed in to change notification settings - Fork 323
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
Support test retry filtering #4244
Comments
@NGloreous our recommendation is to use translation layer. The logic which determines what needs to be re run etc needs to be the guy which is invoking translation layer. We follow a same mechanism in Visual Studio Test Task today. |
@NGloreous Listing the possible options below. -> Leveraging a custom attribute seems to be the best route here. Is it possible to revisit the option of updating the test code ? |
@cltshivash for a new extension point, how much work are we talking? We are willing to do this work and feel it would be worth doing. We'd like to avoid the custom test attribute and don't feel it gives us the flexibility we want. |
@NGloreous Can you add more information on the flexibility part ? All the current execution extension is driven through attributes and a new extension not declared on the code will need a place to be declared (probably run settings ?) and second it needs to support all the attribute driven extensions which are supported today. |
@cltshivash the flexibility to onboard new code without having to change it all. Also we would like the flexibility to delay retries until the end of the test run vs inline retries immediately. I don't think attributes would allow us to do this. |
@cltshivash another thing is we don't necessarily want to do an "inline" retry (e.g. just call the test method a second time if the test fails). We've found doing a retry like this doesn't help much for our tests. What does help is starting "fresh" by re-creating the test class object or by retrying in a new process (this is needed because often time failures are caused by tests "leaking" state). I don't think using custom attributes would support this. Can this even be accomplished from within testfx? I would imagine if we want to retry in a new process this logic would need to go into vstest? |
Hi @NGloreous I am doing this in my team. I am running all the tests calling the VSTest.Console for each test. I read the results and I decided when to re-run the test and how many times the test should re-run. As you said, would be great to have this capability here. |
The simplest of solutions, from a user perspective, would be a switch on vstest.console /RerunAttempts:{number} with a default value of 0. Seems to me this would be the simplest solution from an implementation perspective too. Gather up all the failing tests and rerun, of course observing all other switches but tweaking [test file names] and /Tests:[test name]. In particular /Parallell is important so only the test container(s) that contain failing tests are rerun in separate runs, rescheduled immediately at the back of the queue when that particular container run has finished with failed tests. This would be most efficient eliminating the wait for a complete run before rescheduling failing tests. On big runs with many test containers there is always a trailing part were the parallelism is weak, simply because not all test container are equally weighted. So in this phase typically cores/threads are available but not exploited. This rather simple first approximation would therefore have the benefit of exploiting "dead time" at the end of a big /Parallell run filling in the blanks re-running tests that failed, basically on free time. And I agree, starting up a separate process is the most desirable way to do this because it catches a lot of failing issues in the simplest way possible. Then you could extend by adding attributes to control single tests/classes, but that wouldn't be my first priority. |
Moving this issue over to vstest. |
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 |
Description
Add an extensibility point to VSTest to enable custom logic to determine if a failed test should be retried.
The OneDrive team currently uses a custom built test harness to run our tests. To deal with test flakyness we need to retry tests and we have built up custom logic to determine when it's acceptable to retry tests and how many times a test can retry. We would like to migrate to VSTest but we need this support to do it. We're open to contributing.
The extension should have the following context provided:
The extension should be able to control
The retry filter extension to use should be able to be specified via command line and/or run settings.
The text was updated successfully, but these errors were encountered: