wait until the server started

By waiting, we are sure that when the task finishes, the server is ready
to receive requests