In such cases it is better to await on some outcome of the asynchronous calculation. In Java ecosystem we have awaitility (https://github.com/awaitility/awaitility) which provides a bunch of utility methods in this spirit.
That's how our tests worked, but you still must choose a timeout or you will wait forever when you do not receive the response you're listening for.
Setting up the CI system to report failure on the first error would have helped a lot too. Waiting on a single timeout was not too bad. The problem was waiting on hundreds of them.