private int resolveTimeout(SofaRequest request, ConsumerConfig consumerConfig, ProviderInfo providerInfo) {
        // 动态配置优先
        final String dynamicAlias = consumerConfig.getParameter(DynamicConfigKeys.DYNAMIC_ALIAS);
        if (StringUtils.isNotBlank(dynamicAlias)) {
            String dynamicTimeout = null;
            DynamicConfigManager dynamicConfigManager = DynamicConfigManagerFactory.getDynamicManager(
                consumerConfig.getAppName(),
                dynamicAlias);

            if (dynamicConfigManager != null) {
                dynamicTimeout = dynamicConfigManager.getConsumerMethodProperty(request.getInterfaceName(),
                    request.getMethodName(),
                    "timeout");
            }

            if (DynamicHelper.isNotDefault(dynamicTimeout) && StringUtils.isNotBlank(dynamicTimeout)) {
                return Integer.parseInt(dynamicTimeout);
            }
        }
        // 先去调用级别配置
        Integer timeout = request.getTimeout();
        if (timeout == null || timeout <= 0) {
            // 取客户端配置（先方法级别再接口级别）
            timeout = consumerConfig.getMethodTimeout(request.getMethodName());
            if (timeout == null || timeout <= 0) {
                // 再取服务端配置
                timeout = StringUtils.parseInteger(providerInfo.getAttr(ATTR_TIMEOUT));
                if (timeout == null || timeout <= 0) {
                    // 取框架默认值
                    timeout = getIntValue(CONSUMER_INVOKE_TIMEOUT);
                }
            }
        }
        return timeout;
    }
@Test
    public void testResolveTimeout() throws NoSuchMethodException, InvocationTargetException, IllegalAccessException {
        Method resolveTimeoutMethod = AbstractCluster.class.getDeclaredMethod("resolveTimeout", SofaRequest.class,
            ConsumerConfig.class, ProviderInfo.class);
        resolveTimeoutMethod.setAccessible(true);

        SofaRequest sofaRequest = new SofaRequest();
        ConsumerConfig consumerConfig = new ConsumerConfig();
        ProviderInfo providerInfo = new ProviderInfo();
        Integer defaultTimeout = (Integer) resolveTimeoutMethod.invoke(abstractCluster, sofaRequest, consumerConfig,
            providerInfo);
        Assert.assertTrue(defaultTimeout == 3000);

        providerInfo.setStaticAttr(ProviderInfoAttrs.ATTR_TIMEOUT, "5000");
        Integer providerTimeout = (Integer) resolveTimeoutMethod.invoke(abstractCluster, sofaRequest, consumerConfig,
            providerInfo);
        Assert.assertTrue(providerTimeout == 5000);

        consumerConfig.setTimeout(2000);
        Integer consumerTimeout = (Integer) resolveTimeoutMethod.invoke(abstractCluster, sofaRequest, consumerConfig,
            providerInfo);
        Assert.assertTrue(consumerTimeout == 2000);

        sofaRequest.setTimeout(1000);
        Integer invokeTimeout = (Integer) resolveTimeoutMethod.invoke(abstractCluster, sofaRequest, consumerConfig,
            providerInfo);
        Assert.assertTrue(invokeTimeout == 1000);

    }