Remove Thread.sleep in test