webdriverio / selenium-standalone

A Node.js based package and CLI library for launching Selenium with WebDrivers support (Chrome, Firefox, IE, Edge)
https://webdriver.io
Other
911 stars 221 forks source link

Firefox looses to open display during second run #219

Closed Desperado closed 8 years ago

Desperado commented 8 years ago

Hello, this problem happens for me while running chimp e2e tests second, third or any other time, while on headless linux host, freshly built on docker. First time after image is built test runs well.

Firefox version 48.0 Selenium standalone 2.53.1

What should I do to forgot about this trouble? Why it looses to find the screen and open display?

[chimp][helper] setupBrowserAndDDP had error
{ [Error: Unable to connect to host localhost on port 7055 after 45000 ms. Firefox console output:
Error: cannot open display: :99
]
  message: 'Unable to connect to host localhost on port 7055 after 45000 ms. Firefox console output:\nError: cannot open display: :99\n',
  type: 'RuntimeError',
  seleniumStack: 
   { status: 13,
     type: 'UnknownError',
     message: 'An unknown server-side error occurred while processing the command.',
     orgStatusMessage: 'Unable to connect to host localhost on port 7055 after 45000 ms. Firefox console output:\nError: cannot open display: :99\n' } }
Error: Unable to connect to host localhost on port 7055 after 45000 ms. Firefox console output:
    at Object.Future.wait (/jenkins/workspace/docker_selenium/node_modules/chimp/node_modules/xolvio-sync-webdriverio/node_modules/fibers/future.js:449:15)
    at Object.<anonymous> (/jenkins/workspace/docker_selenium/node_modules/chimp/node_modules/xolvio-sync-webdriverio/node_modules/wdio-sync/build/index.js:345:27)
    at initBrowser (/jenkins/workspace/docker_selenium/node_modules/chimp/dist/lib/chimp-helper.js:161:17)
    at Object.setupBrowserAndDDP (/jenkins/workspace/docker_selenium/node_modules/chimp/dist/lib/chimp-helper.js:215:7)
    at /jenkins/workspace/docker_selenium/node_modules/chimp/dist/lib/cucumberjs/hooks.js:21:24
    at /jenkins/workspace/docker_selenium/node_modules/chimp/node_modules/meteor-promise/fiber_pool.js:32:39
    - - - - -
Error: cannot open display: :99

Here is also my xvfb start-stop script

XVFB=/usr/bin/Xvfb
XVFBARGS=":99 -screen 0 1600x1200x24 -fbdir /var/run -ac -nolisten tcp"
PIDFILE=/var/run/xvfb.pid
case "$1" in
  start)
    echo -n "Starting virtual X frame buffer: Xvfb"
    start-stop-daemon --start --quiet --pidfile $PIDFILE --make-pidfile --background --exec $XVFB -- $XVFBARGS
    echo "."
    ;;
  stop)
    echo -n "Stopping virtual X frame buffer: Xvfb"
    start-stop-daemon --stop --quiet --pidfile $PIDFILE
    echo "."
    ;;
  restart)
    $0 stop
    $0 start
    ;;
  *)
        echo "Usage: /etc/init.d/xvfb {start|stop|restart}"
        exit 1
esac

exit 0
vvo commented 8 years ago

I am not sure this is a specific selenium-standalone bug. If you are able to prove there's a bug in selenium-standalone I would be happy to discuss it. This seems more a selenium issue to me for now. Good luck

Desperado commented 8 years ago

@vvo I have already found the root issue, it is with the locks and some directories generated after selenium-standalone install. Only cleaning it together with npm registry in /tmp folder, will make it working https://github.com/xolvio/qualityfaster/issues/64

vvo commented 8 years ago

Nice, if there are any action needed to be done in selenium-standalone, please open a PR ;)

vvo commented 8 years ago

Otherwise close the issue :p