public void waitFor(final Supplier<RequestSpecification> supplier, final HttpChecker checker) throws TimeoutException {
        final Map<String, String> contextMap = MDC.getCopyOfContextMap();
        Future<?> future = EXECUTOR.submit(() -> {
            MDC.setContextMap(contextMap);
            
            for (int i = 0; i < retryTimes; i++) {
                try {
                    checker.check(supplier);
                    return;
                } catch (AssertionError e) {
                    log.debug(e.getMessage());
                }
                
                try {
                    TimeUnit.MILLISECONDS.sleep(timeInRetry.toMillis());
                } catch (InterruptedException ex) {
                    log.error(ex.getMessage(), ex);
                    break;
                }
            }
            log.info("check endpoint({}) successful", MDC.get("endpoint"));
        });
        
        try {
            future.get(timeout.toMillis(), TimeUnit.MILLISECONDS);
        } catch (ExecutionException | InterruptedException | TimeoutException e) {
            future.cancel(true);
            throw new TimeoutException("checking endpoint '" + MDC.get("endpoint") + "' timeout after " + timeout);
        }
    }
Check if the endpoint is successful. If unsuccessful, retry until the maximum number of times is reached.

@param supplier supplier
@param checker checker
@throws TimeoutException TimeoutException
shenyu-e2e/shenyu-e2e-engine/src/main/java/org/apache/shenyu/e2e/engine/scenario/function/WaitForHelper.java