All questions

Advanced · Java · Framework utilities

Java: retry a flaky action

Commonly asked: Java automation / SDET interview rounds · ~12 min

Write static <T> T retry(java.util.function.Supplier<T> action, int attempts) that calls action until it succeeds, up to attempts times.

Checking your membership…