Fix the test to wait until done