WebIDE terminal has connection failure on docker executor

Summary

When using the docker executor with the webIDE terminal, the connection will fail almost all the time. This is due to GitLab not giving the container enough time to start up before timing out with a connection failure error.

Steps to reproduce

  1. Set up the webIDE terminal and configure it to use a runner with a docker executor. Example WebIDE1
  2. Open the WebIDE and click connect. After a few seconds, a connection failure message shows up. examplewebIDE2
    • But the container is running on the runner docker host and accepting connectionswebIDE3
  3. Creating a breakpoint in the sources section of the browsers gives the container a bit of time to accept connectionswebIDE4
  4. Resume execution and the webIDE terminal session connectswebIDE5

Example Project

What is the current bug behavior?

Not enough time is given to the container to allow it to start accepting connections

What is the expected correct behavior?

The Web Terminal should wait longer before timing out.

Relevant logs and/or screenshots

Output of checks

Results of GitLab environment info

Expand for output related to GitLab environment info
(For installations with omnibus-gitlab package run and paste the output of:
`sudo gitlab-rake gitlab:env:info`)

(For installations from source run and paste the output of:
`sudo -u git -H bundle exec rake gitlab:env:info RAILS_ENV=production`)

Results of GitLab application Check

Expand for output related to the GitLab application check

(For installations with omnibus-gitlab package run and paste the output of: sudo gitlab-rake gitlab:check SANITIZE=true)

(For installations from source run and paste the output of: sudo -u git -H bundle exec rake gitlab:check RAILS_ENV=production SANITIZE=true)

(we will only investigate if the tests are passing)

Possible fixes

Edited by Alvin Gounder