public void poll()

in src/main/java/org/apache/sling/testing/clients/util/poller/Polling.java [111:134]


    public void poll(long timeout, long delay) throws TimeoutException, InterruptedException {
        long start = System.currentTimeMillis();
        long effectiveTimeout = TimeoutsProvider.getInstance().getTimeout(timeout);

        do {
            try {
                boolean success = call();
                if (success) {
                    waited = System.currentTimeMillis() - start;
                    return;
                }
            } catch (InterruptedException e) {
                throw e; // Never inhibit InterruptedException
            } catch (Exception e) {
                exceptions.add(e);
                lastException = e;
            }
            Thread.sleep(delay);
        } while (System.currentTimeMillis() < start + effectiveTimeout);

        waited = System.currentTimeMillis() - start;
        throw new TimeoutException(String.format(message(), effectiveTimeout, delay) +
                " Last exception was: " + this.getLastException());
    }