title: Vert.x Async Testing
body: <p>I'm new to vert.x. I'm trying to run some basic tests and benchmarks etc to evaluate the framework (so I'm probably doing lots wrong!)</p>
  
  <p>One thing I'm interested is the performance costs of running 'controller' level tests. I set up a test that should repeatedly spin up and tear down a httpclient.</p>
  
  <pre><code>@Repeat(100)
  @Test
  public void testMyApplication(TestContext context) {
  
      final Async async = context.async(1);
      vertx.createHttpClient().getNow(8080, "localhost", "/",
              response -&gt; {
                  response.handler(body -&gt; {
                      context.assertTrue(body.toString().contains("Hello"));
                      context.assertEquals(200, response.statusCode());
                      async.complete();
                  });
              });
      async.awaitSuccess();
  }
  </code></pre>
  
  <p>However this will occasionally fail with.</p>
  
  <pre><code>SEVERE: io.netty.channel.AbstractChannel$AnnotatedConnectException: Connection refused: localhost/127.0.0.1:8080
  </code></pre>
  
  <p>What's a better way to spin up multiple clients and ensure the tests run in order or with some controlled parallelism? </p>