How to avoid the initial service delay for STM32 unit tests?

I have recently started doing more of TDD for my firmware projects and I noticed the following line:

What I don’t like about it is that each test requires at least 2 seconds to run, and it’s hardcoded. Since the host machine (my PC) can drive the UART however it wants. Why do we not use a hardware handshake where the host waits for the MCU to send an INIT_DONE message?

Please let me know how this could be accomplished.