@Override
        public void evaluate() {
            int attempts = 0;
            final List<Throwable> causes = new ArrayList<>();

            while (++attempts <= maxTries) {
                try {
                    base.evaluate();
                    return;
                } catch (Throwable throwable) {
                    log.warn("Retrying @Flaky-annotated test: {}", description.getDisplayName());
                    causes.add(throwable);
                }
            }

            throw new IllegalStateException(
                "@Flaky-annotated test failed despite retries.",
                new MultipleFailureException(causes)
            );
        }
<p>
    JUnit 4 @Rule that implements retry for flaky tests (tests that suffer from sporadic random failures).
</p>
<p>
    This rule should be used in conjunction with the @{@link Flaky} annotation. When this Rule is applied to a test
    class, any test method with this annotation will be invoked up to 3 times or until it succeeds.
</p>
<p>
    Tests should <em>not</em> be marked @{@link Flaky} for a long period of time. Every usage should be
    accompanied by a GitHub issue URL, and should be subject to review at a suitable point in the (near) future.
    Should the review date pass without the test's instability being fixed, the retry behaviour will cease to have an
    effect and the test will be allowed to sporadically fail again.
</p>
test-support/src/main/java/org/testcontainers/testsupport/FlakyTestJUnit4RetryRule.java