Correct async testing

Now the test won't finish until the async code has finished executing