joeljeske / karma-parallel

A Karma JS Framework to support sharding tests to run in parallel across multiple browsers

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Support for Chrome Headless

felpel opened this issue · comments

I'm submitting a ...

  • bug report
  • feature request

What is the current behavior?

I'm able to use the plugin with Chrome as a browser, but when I want to execute a test run for my production environment, I'm getting errors and I suspect it might be related to ChromeHeadless:

ng test --watch=false --code-coverage

15 08 2018 22:05:09.113:INFO [framework:karma-parallel]: sharding specs across 3 browsers
 10% building modules 1/1 modules 0 active(node:3056) DeprecationWarning: Tapable.plugin is deprecated. Use new API on `.hooks` instead
15 08 2018 22:05:27.111:INFO [karma]: Karma v2.0.5 server started at http://0.0.0.0:9876/
15 08 2018 22:05:27.112:INFO [launcher]: Launching browsers ChromeHeadless, ChromeHeadless, ChromeHeadless with unlimited concurrency
15 08 2018 22:05:27.124:INFO [launcher]: Starting browser ChromeHeadless
15 08 2018 22:05:27.147:INFO [launcher]: Starting browser ChromeHeadless
15 08 2018 22:05:27.168:INFO [launcher]: Starting browser ChromeHeadless                                             15 08 2018 22:06:03.731:INFO [HeadlessChrome 0.0.0 (Windows 10 0.0.0)]: Connected on socket jGL78oXECkDIKtDSAAAA with id 19104534
15 08 2018 22:06:03.742:INFO [HeadlessChrome 0.0.0 (Windows 10 0.0.0)]: Connected on socket hcmeF4wVyyZHpFZVAAAB with id 36435148
15 08 2018 22:06:04.103:INFO [HeadlessChrome 0.0.0 (Windows 10 0.0.0)]: Connected on socket QLGOZuBQT0iz5YnTAAAC with id 64640218
15 08 2018 22:06:33.736:WARN [HeadlessChrome 0.0.0 (Windows 10 0.0.0)]: Disconnected (1 times), because no message in 30000 ms.
HeadlessChrome 0.0.0 (Windows 10 0.0.0) ERROR
  Disconnected, because no message in 30000 ms.
HeadlessChrome 0.0.0 (Windows 10 0.0.0) ERROR
  Disconnected, because no message in 30000 ms.

HeadlessChrome 0.0.0 (Windows 10 0.0.0) ERROR
  Disconnected, because no message in 30000 ms.

15 08 2018 22:06:33.743:WARN [HeadlessChrome 0.0.0 (Windows 10 0.0.0)]: Disconnected (1 times), because no message in 30000 ms.
HeadlessChrome 0.0.0 (Windows 10 0.0.0) ERROR
  Disconnected, because no message in 30000 ms.
HeadlessChrome 0.0.0 (Windows 10 0.0.0) ERROR
  Disconnected, because no message in 30000 ms.

HeadlessChrome 0.0.0 (Windows 10 0.0.0) ERROR
  Disconnected, because no message in 30000 ms.

15 08 2018 22:06:34.156:WARN [HeadlessChrome 0.0.0 (Windows 10 0.0.0)]: Disconnected (1 times), because no message in 30000 ms.
HeadlessChrome 0.0.0 (Windows 10 0.0.0) ERROR
  Disconnected, because no message in 30000 ms.
HeadlessChrome 0.0.0 (Windows 10 0.0.0) ERROR
  Disconnected, because no message in 30000 ms.

HeadlessChrome 0.0.0 (Windows 10 0.0.0) ERROR
  Disconnected, because no message in 30000 ms.

15 08 2018 22:06:35.744:WARN [launcher]: ChromeHeadless was not killed in 2000 ms, sending SIGKILL.
15 08 2018 22:06:35.751:WARN [launcher]: ChromeHeadless was not killed in 2000 ms, sending SIGKILL.
15 08 2018 22:06:36.214:WARN [launcher]: ChromeHeadless was not killed in 2000 ms, sending SIGKILL.
15 08 2018 22:06:37.784:WARN [launcher]: ChromeHeadless was not killed by SIGKILL in 2000 ms, continuing.
15 08 2018 22:06:37.875:WARN [launcher]: ChromeHeadless was not killed by SIGKILL in 2000 ms, continuing.

What is the expected behavior?

It should be able to run tests in any headless environment since headless browsers have been supported for a while in Karma's ecosystem.

Please tell us about your environment:

  • version: 0.2.9
  • Browser: Chrome, Chrome headless
  • Language: TypeScript 2.9.2

Other information

We are currently using this plugin and ChromeHeadless without issues. I'm guessing there is something else going on to cause the issue you're experiencing.

@rosstroha I've tried again on my work machine and it seems that it might be related to the timeout that was not high enough for my other computer; it works like a charm ❤️

I will modify my build and close this bug when it has been successfully executed in our CI build.

Increasing the timeout in Karma's configuration fixed the issue. Closing this issue now.