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

Tests are running slower on the launched chrome browser #262

Open
tgvrssanthosh opened this issue Jan 10, 2023 · 4 comments
Open

Tests are running slower on the launched chrome browser #262

tgvrssanthosh opened this issue Jan 10, 2023 · 4 comments

Comments

@tgvrssanthosh
Copy link

Summary

Tests are running slower on the launched chrome browser

Steps to reproduce

  1. git clone https://github.com/pluralsight-projects/SampleKarmaJasmineProject.git
  2. Run yarn && yarn run test
  3. By default, it is configured to launch the Chrome browser. There are only three tests and it takes greater than one second in the newly launched chrome.
  4. Now switch the launcher to Firefox by replacing karma-chrome-launcher to karma-firefox-launcher in package.json. Similarly, in karma.conf.js, replace karma-chrome-launcher in plugins with karma-firefox-launcher and replace browsers from Chrome to Firefox.
  5. Run yarn && yarn run test. It will launch Firefox now and the tests run way faster than chrome.

Description

KarmaJS internally spawns the browser in a child process along with a custom user-data-dir

I observed that on spawned chrome (with a custom user-data-dir), the tests are running very slow as compared to other browsers like Firefox.

I have validated the same by running other test runner such as TestemJS which also spawns the chrome with custom user-data-dir.

In the attached screenshots, you can see that on chrome it is taking around 2 seconds to run the tests where as on Firefox it takes less than 200ms.

I also observed that as more and more tests start running, spawned chrome catches up the speed but falls short (even after catching up) compared to running the tests on non-spawned chrome.

I raised a ticket on the chromium team as well for the same
https://bugs.chromium.org/p/chromium/issues/detail?id=1406168

I'm raising this ticket here as well so that others will be aware of this issue.

Screenshots

Screen Shot 2023-01-10 at 2 09 49 PM

Screen Shot 2023-01-10 at 2 10 46 PM

@pmvald
Copy link
Member

pmvald commented Apr 20, 2023

Quick thought: could this be related to #217 ??

@lferreira07
Copy link

I was having the same issue when using node 14.20x, with node 16.x this does not happen to me.

"karma": "~6.4.1", "karma-chrome-launcher": "~3.2.0"

@tgvrssanthosh
Copy link
Author

Quick thought: could this be related to #217 ??

I tried with '--disable-ipc-flooding-protection' and seeing the same result of slow running tests.

@tgvrssanthosh
Copy link
Author

I was having the same issue when using node 14.20x, with node 16.x this does not happen to me.

"karma": "~6.4.1", "karma-chrome-launcher": "~3.2.0"

@lferreira07 I'm also on 16.x version of node and still running into the issue. I believe it has something to do with the chromium browser rather than the node version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants