@After public void tearDown() throws InterruptedException { IOLoop.INSTANCE.addCallback( new AsyncCallback() { @Override public void onCallback() { IOLoop.INSTANCE.stop(); } }); Thread.sleep(300); // give the IOLoop thread some time to gracefully shutdown }