waitFor test helper