@Test
    public void testNoRouteToHost() {
        assertThrows(IOException.class,
            () -> selector.connect("0", new InetSocketAddress("some.invalid.hostname.foo.bar.local", server.port), BUFFER_SIZE, BUFFER_SIZE));
    }
Sending a request to a node with a bad hostname should result in an exception during connect
clients/src/test/java/org/apache/kafka/common/network/SelectorTest.java