@Override
    public void start() {
        if (!PluginConfigManager.getPluginConfig(DiscoveryPluginConfig.class).isEnableRegistry()) {
            return;
        }
        final LbConfig lbConfig = PluginConfigManager.getPluginConfig(LbConfig.class);
        maxSize = lbConfig.getMaxRetryConfigCache();
        defaultRetry = Retry.create(DefaultRetryConfig.create());
        initRetryPolicy(lbConfig);
    }
@Test
    public void disableAllTimeout() {
        lbConfig.setEnableSocketConnectTimeoutRetry(false);
        lbConfig.setEnableTimeoutExRetry(false);
        lbConfig.setEnableSocketReadTimeoutRetry(false);
        lbConfig.setSpecificExceptionsForRetry(Collections.singletonList("java.lang.IllegalArgumentException"));
        final RetryServiceImpl retryService = new RetryServiceImpl();
        retryService.start();
        final Optional<Object> defaultRetry = ReflectUtils.getFieldValue(retryService, "defaultRetry");
        Assert.assertTrue(defaultRetry.isPresent() && defaultRetry.get() instanceof Retry);
        final Predicate<Throwable> throwablePredicate = ((Retry) defaultRetry.get()).config().getThrowablePredicate();
        Assert.assertFalse(throwablePredicate.test(null));
        Assert.assertFalse(throwablePredicate.test(new SocketTimeoutException("read timed out")));
        Assert.assertFalse(throwablePredicate.test(new SocketTimeoutException("connect timed out")));
        final Exception exception = new Exception("error", new SocketTimeoutException("connect timed out"));
        Assert.assertFalse(throwablePredicate.test(exception));
        final Exception exception2 = new Exception("error", new SocketTimeoutException("read timed out"));
        Assert.assertFalse(throwablePredicate.test(exception2));
        final TimeoutException timeoutException = new TimeoutException();
        Assert.assertFalse(throwablePredicate.test(timeoutException));
        final Exception timeoutException2 = new Exception("error", new TimeoutException("read timed out"));
        Assert.assertFalse(throwablePredicate.test(timeoutException2));
        final IllegalArgumentException illegalArgumentException = new IllegalArgumentException();
        Assert.assertTrue(throwablePredicate.test(illegalArgumentException));
    }