test: return response on receiving request instead of using wait()

wait() makes test fragile.