Skip to content
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
Closed

Chrome not captured when running tests on Travis #1144

justinmanley opened this issue Jul 24, 2014 · 10 comments

Comments

@justinmanley
Copy link

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
Copy link
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.

@justinmanley
Copy link
Author

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
Copy link
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?

@henvic
Copy link

henvic commented Aug 21, 2014

👍 same problem here.

@pkozlowski-opensource
Copy link
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 :-)

@MrOrz
Copy link

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
Copy link

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

binji added a commit to binji/naclbind.js that referenced this issue Sep 30, 2014
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
Copy link

👍 @MrOrz

@dignifiedquire
Copy link
Member

Not an issue with karma, so closing.

@ghost
Copy link

ghost commented Aug 5, 2016

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

davidstutz added a commit to davidstutz/jasmine-travis-example that referenced this issue Aug 16, 2016
MDev128 added a commit to MDev128/react-draggable that referenced this issue Aug 13, 2018
ludarkhorse added a commit to ludarkhorse/ReactGrid that referenced this issue Feb 21, 2023
wdavis122 added a commit to wdavis122/react-draggable that referenced this issue Jun 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants