@Test
public void testSharedServersRoundRobinButFirstStartAndStopServer() throws Exception {
// Start and stop a server on the same port/host before hand to make sure it doesn't interact
CountDownLatch latch = new CountDownLatch(1);
HttpServer theServer = vertx.createHttpServer(new HttpServerOptions().setPort(4321));
theServer.websocketHandler(ws -> {
fail("Should not connect");
}).listen(ar -> {
if (ar.succeeded()) {
latch.countDown();
} else {
fail("Failed to bind server");
}
});
awaitLatch(latch);
CountDownLatch closeLatch = new CountDownLatch(1);
theServer.close(ar -> {
assertTrue(ar.succeeded());
closeLatch.countDown();
});
assertTrue(closeLatch.await(10, TimeUnit.SECONDS));
testSharedServersRoundRobin();