Make the initial `Run` API call wait for the connection to be ready
Over in the runner repo, the steps-integration integration tests are failing withe following error:
ERROR: Job failed (system failure): container exec on "fb713040a3f77c360ea1c8a7829c03c6a9f91cf3189952b03c9ae347df352e78" finished with: executing step request: running job request: rpc error: code = Unavailable desc = connection error: desc = "error reading server preface: io: read/write on closed pipe"
The error appears to be caused by sending the Run request before the connection is actually ready. This CallOption waits for the connection to be ready before sending the Run request. Note that I have tested this manually and have confirmed that it works. By "works" I mean than one can create a client and send a run request before the service is running at all, then start the service. The run request will block until the service is up and ready, and the request will eventually complete successfully. However, I am unable to write a test to reproduce it here because it requires both the client modified here, AND the docker dialer in https://gitlab.com/gitlab-org/gitlab-runner/-/blob/main/executors/docker/internal/exec/dialer.go.
This is further justification to create a step-runner-client project, either as a standalone project or as a separate module within the step-runner project.
See: