private void assertWithRetries()

in src/main/java/org/apache/sling/launchpad/webapp/integrationtest/servlets/resolver/errorhandler/ErrorHandlingTest.java [92:114]


    private void assertWithRetries(
            String url, int expectedStatus, String expectedContent, String httpMethod, List<NameValuePair> params)
            throws Throwable {
        final long endTime = System.currentTimeMillis() + RETRY_MAX_TIME_SEC * 1000L;
        Throwable caught = null;
        while (System.currentTimeMillis() < endTime) {
            try {
                caught = null;
                assertContains(getContent(url, CONTENT_TYPE_HTML, params, expectedStatus, httpMethod), expectedContent);
                break;
            } catch (Throwable t) {
                caught = t;
                try {
                    Thread.sleep(RETRY_INTERVAL_MSEC);
                } catch (InterruptedException ignored) {
                }
            }
        }

        if (caught != null) {
            throw caught;
        }
    }