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 driver keeps crashing when i run wct #3229

Closed
paladox opened this issue Dec 6, 2017 · 16 comments
Closed

Chrome driver keeps crashing when i run wct #3229

paladox opened this issue Dec 6, 2017 · 16 comments

Comments

@paladox
Copy link
Contributor

paladox commented Dec 6, 2017

Hi, we are trying to update the os that is run on gerrit's ci. But we are finding chrome is crashing (failing the tests).

I run

./polygerrit-ui/app/run_test.sh

But then it fails with

Error: Error: [get("http://localhost:8000/components/tmp.clZ2Ko6zjG/generated-index.html?cli_browser_id=0")] Error response status: 6 Selenium error: no such session
(Driver info: chromedriver=2.33.506092 (733a02544d189eeb751fe0d7ddca79a0ee28cce4),platform=Linux 4.9.49-moby x86_64) (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 16 milliseconds
Build info: version: '3.0.1', revision: '1969d75', time: '2016-10-18 09:48:19 -0700'
System info: host: '369da22d71d9', ip: '172.17.0.2', os.name: 'Linux', os.arch: 'amd64', os.version: '4.9.49-moby', java.version: '1.8.0_151'
Driver info: org.openqa.selenium.chrome.ChromeDriver
Capabilities [{message=unknown error: Chrome failed to start: crashed
(Driver info: chromedriver=2.33.506092 (733a02544d189eeb751fe0d7ddca79a0ee28cce4),platform=Linux 4.9.49-moby x86_64), platform=ANY}]
Session ID: e1d6ecb57ad22749b1db498385b80231

I tryed everything from using --no-sandbox to --headless and still does not work.

We are trying to update the os to stretch.

https://gerrit-review.googlesource.com/#/c/gerrit-ci-scripts/+/139511/

This only happends inside docker.

@paladox
Copy link
Contributor Author

paladox commented Dec 20, 2017

Bump

@paladox
Copy link
Contributor Author

paladox commented Dec 28, 2017

Filled this upstream here https://bugs.chromium.org/p/chromedriver/issues/detail?id=2190&can=2&start=0&num=100&q=&colspec=ID%20Status%20Pri%20Owner%20Summary&groupby=&sort=

Seems this problem is related to chrome supporting headless mode. Seems a bug was introduced that means that UI less os's will have to use headless mode otherwise chrome wont work for them.

@justinfagnani
Copy link
Contributor

Thanks for the info. We'll work on supporting headless.

@paladox
Copy link
Contributor Author

paladox commented Jan 2, 2018

Thanks :).

@aomarks
Copy link
Member

aomarks commented Jan 2, 2018

Not sure if this will solve the problem, but if you npm install to pick up browser-capabilities >= 0.2.2, polyserve will correctly identify Chrome Headless as a browser that can handle ES6 etc.

@paladox
Copy link
Contributor Author

paladox commented Jan 4, 2018

@justinfagnani i've copy parts of wct-headless over here Polymer/wct-local#71

@hastebrot
Copy link

hastebrot commented Jan 10, 2018

@paladox I've updated wct-local to your branch.

+    "wct-local": "paladox/wct-local#patch-3",
+    "web-component-tester": "6.4.2"

But somehow wct can not find the local plugin. For details see my PR linked abve.

Failed to load plugin "local": Error: Cannot find module 'wct-local'
error:   cli runtime exception: Failed to load plugin "local": Error: Cannot find module 'wct-local'

Update: I'm obviously too dumb for npm. I switched to yarn, ran the tests, and still get the error with selenium.

@paladox
Copy link
Contributor Author

paladox commented Jan 10, 2018

You need to also do

'plugins': {
'local': {
'skipSeleniumInstall': true,
‘disabled’: true,
},
'headless': {
'skipSeleniumInstall': true,
'disabled’: false,
'browsers': [
'chrome'
],
'browsersOptions': {
'chrome': [
'start-maximized',
'headless',
'disable-gpu',
'no-sandbox'
]
}
},

@paladox
Copy link
Contributor Author

paladox commented Jan 10, 2018

@hastebrot did you install that globally?

Needs to be installed globally.

@hastebrot
Copy link

Thanks. I'll add a wct.conf.json with this plugin configuration and use wct-local as global npm package.

@paladox
Copy link
Contributor Author

paladox commented Jan 10, 2018

Oh sorry got the configuration wrong, it’s this

'plugins': {
  'local': {
    'skipSeleniumInstall': true,
    'disabled': false,
    'browsers': [
      'chrome'
    ],
    'browsersOptions': {
      'chrome': [
        'start-maximized',
        'headless',
        'disable-gpu',
        'no-sandbox'
      ]
    }
  }
}

@hastebrot
Copy link

hastebrot commented Jan 10, 2018

Great. It worked with your wct.conf.json.

However I had to use yarn for the special dependency. I've never used npm shrinkwrap, but will probably play a bit with it. I don't know if I had to use it as global npm dependency--I also use wct as local dependency. Will play around with this a bit too.

Update: I have to double check, Travis seems to have only used firefox for tests... This is strange, because I'm telling it explicitly in the call to use both browsers: polymer test --local chrome,firefox.

Update update: Ok, now it runs on chrome and twice on firefox (which is also strange, I say "chrome" in the config, and "chrome,firefox" in the command line...). But at least I can confirm that the fix works.

@paladox
Copy link
Contributor Author

paladox commented Jan 16, 2018

@hastebrot
Copy link

hastebrot commented Mar 18, 2018

I've now created a wct-headless.conf.json to run my tests on Travis CI. I use the polymer test --local chrome --local firefox --config-file wct-headless.conf.json.

Unfortunately wct seems to ignore the --config-file parameter. It complains when I use --configFile (as suggested in the readme) or --configfile. However it does not complain when I set the config file path to a path that does not exists, e.g. wct-foobar.conf.json.

When I use the default config file wct.conf.json it starts the browser in headless mode (my setup for Travis CI).

Update: As I use polymer test instead of wct this could of course be an issue with the polymer-cli. This would also explain the discrepancy between --configFile and --config-file. At least it says configFile in the cli source: https://github.com/Polymer/web-component-tester/blob/38dad962a1e4145c885efe5a3ddc0eb6e69ea24a/runner/config.ts#L362-L365.

Update 2: Yeah, somehow the config-file option is not passed correctly from polymer test to wct: https://github.com/Polymer/polymer-cli/blob/189b3c04b6d7386f554649fdf30bc283e6a33496/src/commands/test.ts#L134-L139. It works when I use wct --configFile ... instead of polymer test --config-file ....

{
  "suites": [
    "test/index.html"
  ],
  "environmentImports": [
    "test-fixture/test-fixture.html"
  ],
  "plugins": {
    "local": {
      "browserOptions": {
        "chrome": [
          "headless",
          "disable-gpu",
          "no-sandbox"
        ],
        "firefox": [
          "-headless"
        ]
      }
    }
  }
}

@stale
Copy link

stale bot commented Mar 3, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix label Mar 3, 2020
@stale
Copy link

stale bot commented Mar 3, 2022

This issue has been automatically closed after being marked stale. If you're still facing this problem with the above solution, please comment and we'll reopen!

@stale stale bot closed this as completed Mar 3, 2022
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

4 participants