Is there something we can check for, instead of having a constant delay here? Such tests tend to be brittle and thus cause false positives in continuous integration.

Ideally there would be a message we could just wait for, but it would be fine if we could just check, say, whether a certain process is running, every 100 milliseconds or so, and only give up after a ridiculously long period of time, like 10 seconds. Thay way, when the test is successful (the most common case), it will run with minimal delay, and when the test fails, we know for sure that something is wrong.