New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Chrome not captured when running tests on Travis #1144

Closed
justinmanley opened this Issue Jul 24, 2014 · 10 comments

Comments

Projects
None yet
8 participants
@justinmanley

justinmanley commented Jul 24, 2014

Karma tests are failing on Travis when it tries to run tests in Chrome.

Since I posted this issue on the travis-ci issues page, I've noticed that the tests run successfully in PhantomJS, so I'm wondering if this error may be traced back to Karma.

The error message is:

INFO [launcher]: Starting browser Chrome
WARN [launcher]: Chrome have not captured in 60000 ms, killing.
INFO [launcher]: Trying to start Chrome again (1/2).
WARN [launcher]: Chrome have not captured in 60000 ms, killing.
INFO [launcher]: Trying to start Chrome again (2/2).
WARN [launcher]: Chrome have not captured in 60000 ms, killing.
ERROR [launcher]: Chrome failed 2 times (timeout). Giving up.

Detailed issue report here: travis-ci/travis-ci#2555

@pkozlowski-opensource

This comment has been minimized.

Show comment
Hide comment
@pkozlowski-opensource

pkozlowski-opensource Jul 27, 2014

Member

@manleyjster AFAIK Travis-CI VMs don't have Chrome installed, by default only FFox is present. You could use this one but in this case you need to add

  - "export DISPLAY=:99.0"
  - "sh -e /etc/init.d/xvfb start"

to your TravisCI install as explained here: http://docs.travis-ci.com/user/gui-and-headless-browsers/

Closing as this is an issue with what TravisCI provides and not a bug in Karma. If you want to test on multiple browsers you could use services like SaucLabs or similar.

Member

pkozlowski-opensource commented Jul 27, 2014

@manleyjster AFAIK Travis-CI VMs don't have Chrome installed, by default only FFox is present. You could use this one but in this case you need to add

  - "export DISPLAY=:99.0"
  - "sh -e /etc/init.d/xvfb start"

to your TravisCI install as explained here: http://docs.travis-ci.com/user/gui-and-headless-browsers/

Closing as this is an issue with what TravisCI provides and not a bug in Karma. If you want to test on multiple browsers you could use services like SaucLabs or similar.

@justinmanley

This comment has been minimized.

Show comment
Hide comment
@justinmanley

justinmanley Jul 28, 2014

Thanks for responding - and thanks for the link to the GUI & Headless Browsers article - I hadn't seen that!

I take your point, but I still think it's possible that Karma is implicated in this issue.

If you look through my original issue report, you'll see that I was aware that Chrome is not installed by default on Travis CI and had added the following to my .travis.yml:

- wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | sudo apt-key add -
- sudo sh -c 'echo "deb http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list'
- sudo apt-get update -qq
- sudo apt-get install -qq google-chrome-stable

At your suggestion (from above), I added:

- export DISPLAY=:0
- sh -e /etc/init.d/xvfb start

to my .travis.yml, but to no effect. As before, Karma started Chrome successfully, then failed to capture it: build 31091782.

Evidently it's more complicated than simply needing to start up the virtual X frame buffer.

justinmanley commented Jul 28, 2014

Thanks for responding - and thanks for the link to the GUI & Headless Browsers article - I hadn't seen that!

I take your point, but I still think it's possible that Karma is implicated in this issue.

If you look through my original issue report, you'll see that I was aware that Chrome is not installed by default on Travis CI and had added the following to my .travis.yml:

- wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | sudo apt-key add -
- sudo sh -c 'echo "deb http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list'
- sudo apt-get update -qq
- sudo apt-get install -qq google-chrome-stable

At your suggestion (from above), I added:

- export DISPLAY=:0
- sh -e /etc/init.d/xvfb start

to my .travis.yml, but to no effect. As before, Karma started Chrome successfully, then failed to capture it: build 31091782.

Evidently it's more complicated than simply needing to start up the virtual X frame buffer.

@pkozlowski-opensource

This comment has been minimized.

Show comment
Hide comment
@pkozlowski-opensource

pkozlowski-opensource Aug 2, 2014

Member

@manleyjster I'm just going over various issues on Travis-CI and people are reporting various things about being able to install & start chrome in the Travis VM. Did you try to verify that chrome actually starts properly after you install it?

I still believe that the issue you are facing is due to the chrome not being installed properly and I'm pretty positive that this is not Karma problem. But yes, could you try to add a command to your Travis-CI sript that would open chrome?

Member

pkozlowski-opensource commented Aug 2, 2014

@manleyjster I'm just going over various issues on Travis-CI and people are reporting various things about being able to install & start chrome in the Travis VM. Did you try to verify that chrome actually starts properly after you install it?

I still believe that the issue you are facing is due to the chrome not being installed properly and I'm pretty positive that this is not Karma problem. But yes, could you try to add a command to your Travis-CI sript that would open chrome?

@henvic

This comment has been minimized.

Show comment
Hide comment
@henvic

henvic Aug 21, 2014

👍 same problem here.

henvic commented Aug 21, 2014

👍 same problem here.

@pkozlowski-opensource

This comment has been minimized.

Show comment
Hide comment
@pkozlowski-opensource

pkozlowski-opensource Aug 22, 2014

Member

@henvic could you elaborate? Did you try to verify that Chrome is properly installed on Travis-CI and operational? From what I can see on various info on the net installing Chrome on Travis requires some mad science, ex.: https://twitter.com/domenic/status/502571560944021506

For now it still sounds like Chrome install problem on Travis but I don't have free cycles left to investigate it further. Although I would be interested in the solution :-)

Member

pkozlowski-opensource commented Aug 22, 2014

@henvic could you elaborate? Did you try to verify that Chrome is properly installed on Travis-CI and operational? From what I can see on various info on the net installing Chrome on Travis requires some mad science, ex.: https://twitter.com/domenic/status/502571560944021506

For now it still sounds like Chrome install problem on Travis but I don't have free cycles left to investigate it further. Although I would be interested in the solution :-)

@MrOrz

This comment has been minimized.

Show comment
Hide comment
@MrOrz

MrOrz Aug 27, 2014

I did not got Google Chrome running on Travis-CI either. It installs but we are not sure if it starts up.

I happened to got it running on using the Chromium pre-installed in the Travis-CI VM though, by setting CHROME_BIN, the frame-buffer things, and the --no-sandbox flag.

https://github.com/MrOrz/SeeSS/blob/master/.travis.yml
https://github.com/MrOrz/SeeSS/blob/master/test/karma.conf.js

Build log: https://travis-ci.org/MrOrz/SeeSS/builds/33732670

MrOrz commented Aug 27, 2014

I did not got Google Chrome running on Travis-CI either. It installs but we are not sure if it starts up.

I happened to got it running on using the Chromium pre-installed in the Travis-CI VM though, by setting CHROME_BIN, the frame-buffer things, and the --no-sandbox flag.

https://github.com/MrOrz/SeeSS/blob/master/.travis.yml
https://github.com/MrOrz/SeeSS/blob/master/test/karma.conf.js

Build log: https://travis-ci.org/MrOrz/SeeSS/builds/33732670

@janpaepke

This comment has been minimized.

Show comment
Hide comment
@janpaepke

janpaepke Sep 4, 2014

Thanks, MrOrz!
Your solution works! Awesome! :)

janpaepke commented Sep 4, 2014

Thanks, MrOrz!
Your solution works! Awesome! :)

binji added a commit to binji/naclbind.js that referenced this issue Sep 30, 2014

Add Travis support for karma
Using suggestions from here:
karma-runner/karma#1144

This is currently using chromium, which probably does not have NaCl.
I'll likely need to download a prebuilt binary from the Chrome
waterfall.
@djindjic

This comment has been minimized.

Show comment
Hide comment
@djindjic

djindjic commented Dec 25, 2014

👍 @MrOrz

@dignifiedquire

This comment has been minimized.

Show comment
Hide comment
@dignifiedquire

dignifiedquire Jun 26, 2015

Member

Not an issue with karma, so closing.

Member

dignifiedquire commented Jun 26, 2015

Not an issue with karma, so closing.

@inf3rno

This comment has been minimized.

Show comment
Hide comment
@inf3rno

inf3rno Aug 5, 2016

Contributor

@MrOrz Thanks! The no-sandbox flag was missing. :-)

Contributor

inf3rno commented Aug 5, 2016

@MrOrz Thanks! The no-sandbox flag was missing. :-)

@fvzzy fvzzy referenced this issue Dec 6, 2016

Merged

Migrate to ZAF v2 #18

gldraphael added a commit to gldraphael/chordsheet-editor that referenced this issue Dec 7, 2017

Devfast83 added a commit to Devfast83/react-draggable that referenced this issue Aug 13, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment