@Test
public void testNodeCacheShouldRecycle() {

    {
        Field recycleTimeField = null;
        try {
            //change recycle time to 1 ms
            recycleTimeField = RoundRobinLoadBalance.class.getDeclaredField("RECYCLE_PERIOD");
            recycleTimeField.setAccessible(true);
            recycleTimeField.setInt(RoundRobinLoadBalance.class, 10);
        } catch (NoSuchFieldException e) {
            Assertions.assertTrue(true, "getField failed");
        } catch (SecurityException e) {
            Assertions.assertTrue(true, "getField failed");
        } catch (IllegalArgumentException e) {
            Assertions.assertTrue(true, "getField failed");
        } catch (IllegalAccessException e) {
            Assertions.assertTrue(true, "getField failed");
        }
    }
    int loop = 10000;
    //tmperately add a new invoker
    weightInvokers.add(weightInvokerTmp);
    try {
        Map<Invoker, InvokeResult> resultMap = getWeightedInvokeResult(loop, RoundRobinLoadBalance.NAME);
        assertStrictWRRResult(loop, resultMap);
        // inner nodes cache judgement
        RoundRobinLoadBalance lb = (RoundRobinLoadBalance) getLoadBalance(RoundRobinLoadBalance.NAME);
        Assertions.assertEquals(weightInvokers.size(), lb.getInvokerAddrList(weightInvokers, weightTestInvocation).size());
        weightInvokers.remove(weightInvokerTmp);
        resultMap = getWeightedInvokeResult(loop, RoundRobinLoadBalance.NAME);
        assertStrictWRRResult(loop, resultMap);
        Assertions.assertEquals(weightInvokers.size(), lb.getInvokerAddrList(weightInvokers, weightTestInvocation).size());
    } finally {
        //prevent other UT's failure
        weightInvokers.remove(weightInvokerTmp);
    }
}