Skip to content

Launch Chrome with --disable-renderer-backgrounding flag #123

@cexbrayat

Description

@cexbrayat

On macOS 10.12.4 and Chrome 58.0.3029, it appears that my test suite is slow down if Chrome is in the background. #64 should have fixed it a long ago, but a comment is mentioning the --disable-renderer-backgrounding flag, so I gave it a try, and it does fix my issue:

Before (Angular CLI project using Karma/Chrome):

05 05 2017 10:44:24.333:INFO [launcher]: Starting browser Chrome
05 05 2017 10:44:25.105:INFO [Chrome 58.0.3029 (Mac OS X 10.12.4)]: Connected on socket xKymjhyLh5832m9sAAAA with id 81470424
Chrome 58.0.3029 (Mac OS X 10.12.4): Executed 102 of 102 SUCCESS (5.512 secs / 5.473 secs)
Chrome 58.0.3029 (Mac OS X 10.12.4): Executed 102 of 102 SUCCESS (29.198 secs / 29.164 secs)
Chrome 58.0.3029 (Mac OS X 10.12.4): Executed 102 of 102 SUCCESS (27.1 secs / 26.266 secs)
Chrome 58.0.3029 (Mac OS X 10.12.4): Executed 102 of 102 SUCCESS (28.606 secs / 27.676 secs)

First run is fast, the following are really slow.

After, with this karma.conf.js using the --disable-renderer-backgrounding flag:

    customLaunchers: {
      chromeBackground: {
        base: 'Chrome',
        flags: ['--disable-renderer-backgrounding']
      }
    },
    browsers: ['chromeBackground'],

The tests run faster:

05 05 2017 10:42:54.681:INFO [Chrome 58.0.3029 (Mac OS X 10.12.4)]: Connected on socket cAPHozikOSfUEEnpAAAA with id 83636627
Chrome 58.0.3029 (Mac OS X 10.12.4): Executed 102 of 102 SUCCESS (5.666 secs / 5.628 secs)
Chrome 58.0.3029 (Mac OS X 10.12.4): Executed 102 of 102 SUCCESS (6.864 secs / 6.831 secs)
Chrome 58.0.3029 (Mac OS X 10.12.4): Executed 102 of 102 SUCCESS (7.129 secs / 7.109 secs)

This may be related to the Chrome issue https://bugs.chromium.org/p/chromium/issues/detail?id=605498#c1

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions