@Test
    public void testFailingSources() {
        ConfigSourceSet sources = new ConfigSourceSet(List.of("host0", "host1"));
        JRTConnectionPool connectionPool = new JRTConnectionPool(sources);

        Connection firstConnection = connectionPool.getCurrent();

        // Should change connection, not getting first connection as new
        JRTConnection secondConnection = failAndGetNewConnection(connectionPool, firstConnection);
        assertNotEquals(firstConnection, secondConnection);

        // Should change connection, not getting second connection as new
        JRTConnection thirdConnection = failAndGetNewConnection(connectionPool, secondConnection);
        // Fail a few more times with old connection, as will happen when there are multiple subscribers
        // Connection should not change
        assertEquals(thirdConnection, failAndGetNewConnection(connectionPool, secondConnection));
        assertEquals(thirdConnection, failAndGetNewConnection(connectionPool, secondConnection));
        assertEquals(thirdConnection, failAndGetNewConnection(connectionPool, secondConnection));
        assertNotEquals(secondConnection, thirdConnection);

        // Should change connection, not getting third connection as new
        JRTConnection currentConnection = failAndGetNewConnection(connectionPool, thirdConnection);
        assertNotEquals(thirdConnection, currentConnection);

        // Should change connection, not getting current connection as new
        JRTConnection currentConnection2 = failAndGetNewConnection(connectionPool, currentConnection);
        assertNotEquals(currentConnection, currentConnection2);

        connectionPool.close();
    }
Tests that updating config sources works.
config/src/test/java/com/yahoo/vespa/config/JRTConnectionPoolTest.java