DevOps / Maven Surefire Plugin Interview Questions
How can you make Surefire automatically retry a failing test?
Set <rerunFailingTestsCount> to a positive number:
<configuration> <rerunFailingTestsCount>2</rerunFailingTestsCount> </configuration>
Surefire will re-execute a failing test up to that many extra times before finally marking it failed. It's a pragmatic tool for known-flaky tests, but overusing it can mask real instability.
More Related questions...