public static <R> R eventually(Supplier<R> f, Duration timeout, Duration interval) { long start = now(); long end = start + timeout.toMillis(); Throwable lastError = null; while (now() < end) { try { return f.get(); } catch (Throwable t) { lastError = t; } try { Thread.sleep(interval.toMillis()); } catch (InterruptedException e) { } } val timeStr = PeriodUtils.prettyFormat(now()-start); val messag