Hi Kevin, I can't see an option in the maven-surefire-plugin, but even if there was one, I would seriously not recommend it. If a test case fails non-deterministically, this means it's design is flawed. Test cases should either produce their own resources, or use such that haven't been generated/modified by other tests (which would be expected to have executed before them). Make sure you can easily create isolated sets of test resources. Create a base test class for that, if you have to. Alter your API and adjust it so that you can have an easy entry point from your tests. Do whatever you can to simplify the actual requirements in order for the test to be able to execute independently from the rest of the tests.
I have worked with rather large systems with hundreds of modules and I can clearly say that it is exactly in these kinds of environments where you should be extremely precise with your tests. If a developer doesn't want to fix/debug the test, as it's "flakey", then you have much more serious problems than finding out how to retry a test case. Race conditions are something that should be taken seriously. Just my 5 pence worth of advice; I hope it's worth something to you. Kind regards, Martin Todorov On Fri, Sep 19, 2014 at 5:24 PM, Kevin Burton <[email protected]> wrote: > Is there a way to retry a flakey test? > > I’d basically like to have a flag that retries a failing test 2 or 3 times. > > Flakey and non deterministic tests are a fact of life in more complicated > systems. > > The main problem being that they are impossible to setup again because > they’re usually race conditions. > > If I could just retry the test a second time , that would solve this issue. > > Would be nice to have the build warned that the test is failing though.. > > -- > > Founder/CEO Spinn3r.com > Location: *San Francisco, CA* > blog: http://burtonator.wordpress.com > … or check out my Google+ profile > <https://plus.google.com/102718274791889610666/posts> > <http://spinn3r.com> >
