[server][testUtils] Fix a bug that sometimes caues a dead-lock.

The problem has become obvious by the commit: e6b9472f, which
changes the execution timing.