Thanks for pointing it out. I was just copying from other unit test and didn't know that I can use waitsForDone.