@Test
    void getNewComponentGraph_hangs_waiting_for_valid_config_after_invalid_config() throws Exception {
        dirConfigSource.writeConfig("test", "stringVal \"original\"");
        writeBootstrapConfigs("myId", ComponentTakingConfig.class);

        Container container = newContainer(dirConfigSource);
        final ComponentGraph currentGraph = getNewComponentGraph(container);

        writeBootstrapConfigs("thrower", ComponentThrowingExceptionForMissingConfig.class);
        container.reloadConfig(2);

        assertThrows(ConfigFutureException.class,
                     () -> getNewComponentGraph(container, currentGraph));

        ExecutorService exec = Executors.newFixedThreadPool(1);
        dirConfigSource.clearCheckedConfigs();
        Future<ComponentGraph> newGraph = exec.submit(() -> getNewComponentGraph(container, currentGraph));
        dirConfigSource.awaitConfigChecked(10_000);
        try {
            newGraph.get(1500, TimeUnit.MILLISECONDS);
            fail("Expected waiting for new config.");
        } catch (TimeoutException ignored) {
            // expect to time out
        }

        dirConfigSource.clearCheckedConfigs();
        writeBootstrapConfigs("myId2", ComponentTakingConfig.class);
        container.reloadConfig(3);

        dirConfigSource.awaitConfigChecked(10_000);
        assertNotNull(newGraph.get(1000, TimeUnit.MILLISECONDS));

        container.shutdownConfigRetriever();
        container.shutdown(newGraph.get());
    }
@author Tony Vaagenes
@author gjoranv
@author ollivir
container-core/src/test/java/com/yahoo/container/di/ContainerTest.java