Fix bug in test timeout waiting for application to be ready