Helpers for async unit testing.