Since close is async, thread.sleep in the test