Use "surefire.rerunFailingTestsCount"/"failsafe.rerunFailingTestsCount" to re-run failing tests when testing on AWS Elasticsearch

Description

Currently we have a "retry" step in the Jenkinsfile when running against AWS Elasticsearch, which has a tendency to break connections and make tests fail unexpectedly.

It works, but re-executes all tests whenever any of them fails. This means we can waste dozens of minutes for each run. Sometimes we waste enough time to go over the 1h timeout...

Surefire/Failsafe 3.0.0.M4 introduced a parameter to automatically re-run flaky test, and apparently it only re-runs the few tests that failed. Let's try that?
We would only enable this option when testing against AWS Elasticsearch, of course.

See https://maven.apache.org/surefire/maven-surefire-plugin/test-mojo.html#rerunFailingTestsCount
See http://maven.apache.org/surefire/maven-failsafe-plugin/integration-test-mojo.html#rerunFailingTestsCount

Environment

None
Fixed

Assignee

Yoann Rodière

Reporter

Yoann Rodière

Labels

None

Suitable for new contributors

None

Feedback Requested

None

Components

Fix versions

Priority

Major
Configure