Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error: ChromeDriver did not start within 5000ms

I'm having error

Error: ChromeDriver did not start within 5000ms

on my specific GitLab CE runner, when trying to test Electron app with Spectron.

Error stack is:

1) Test Example "before each" hook for "opens a window":
     Error: ChromeDriver did not start within 5000ms
      at Error (native)
      at node_modules/spectron/lib/chrome-driver.js:63:25
      at Request._callback (node_modules/spectron/lib/chrome-driver.js:120:23)
      at self.callback (node_modules/request/request.js:186:22)
      at Request.onRequestError (node_modules/request/request.js:845:8)
      at Socket.socketErrorListener (_http_client.js:310:9)
      at emitErrorNT (net.js:1278:8)
      at _combinedTickCallback (internal/process/next_tick.js:74:11)
      at process._tickDomainCallback (internal/process/next_tick.js:122:9)

  2) Test Example "after each" hook for "opens a window":
     Error: Application not running
      at Error (native)
      at Application.stop (node_modules/spectron/lib/application.js:56:48)
      at Context.<anonymous> (test/startup/title-test.js:33:20)

My before script is:

before_script:
  - export APT_CACHE_DIR=`pwd`/apt-cache && mkdir -pv $APT_CACHE_DIR
  - set -xe
  - wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add -
  - echo "deb http://dl.google.com/linux/chrome/deb/ stable main" > /etc/apt/sources.list.d/google.list
  - apt-get update -yqqq && apt-get -o dir::cache::archives="$APT_CACHE_DIR" install -y google-chrome-stable xvfb
  - chmod 0777 ./node_modules/.bin/mocha
  - export {no_proxy,NO_PROXY}="127.0.0.1"
  - apt-get install xvfb libxtst6 libxss1 libgtk2.0-0 -y
  - apt-get install libnss3 libasound2 libgconf-2-4 -y

It is same as previous working Runner had, but with added - export {no_proxy,NO_PROXY}="127.0.0.1" since that was one solution (but didn't work for me).

What can i do to change this?

like image 801
Mike Avatar asked Oct 18 '22 19:10

Mike


1 Answers

I just removed that runner and started fresh one. New Runner downloaded Spectron and ChromeDriver on start and Chrome worked.

like image 86
Mike Avatar answered Oct 31 '22 00:10

Mike