Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I re-run a unit test X-amount of times?

My problem is that my unit tests fails from time to time. Most of the times it is successful. I would like to run it X amount of times or just repeat the test case until it fails.

What I can do is to just click on the test and rerun it once more even though it has been successful run, but that is time consuming.

I have had a look in Visual Studio in "Test Explorer" and Resharper "Unit Test Session", but I can find a smart way to rerun all test until it fails.

Is there another way?

Best Regards, Hans

like image 995
user2034859 Avatar asked May 10 '19 12:05

user2034859


1 Answers

I see you mention you have ReSharper - in the Resharper unit test session window you can select the test you are interested in, then click the drop-down next to the Run button and there is a "Run Unit Tests Until Fail" option

Also, see here

like image 155
Matt Hayes Avatar answered Oct 10 '22 14:10

Matt Hayes