HeadlessChrome 84.0.4147 (Linux 0.0.0) ERROR

Viewed 2747

I'm trying to run tests using Karma + HeadlessChrome from an amzn2 AMI (I have a Jenkins installed there). The tests run successful from my local machine, however I'm getting stuck when trying to execute them in Jenkins. I changed the log level of Karma to debug and this is the relevant output:

14 07 2020 06:51:39.801:INFO [karma-server]: Karma v4.1.0 server started at http://0.0.0.0:9876/
14 07 2020 06:51:39.804:INFO [launcher]: Launching browsers ChromeHeadlessNoSandbox with concurrency unlimited
14 07 2020 06:51:39.815:INFO [launcher]: Starting browser ChromeHeadless
14 07 2020 06:51:39.815:DEBUG [launcher]: null -> BEING_CAPTURED
14 07 2020 06:51:39.816:DEBUG [temp-dir]: Creating temp dir at /tmp/karma-99510655
[...]
14 07 2020 06:51:56.165:DEBUG [karma-server]: A browser has connected on socket 1HnLJZHDqfyg-11TAAAA
14 07 2020 06:51:56.187:DEBUG [HeadlessChrome 84.0.4147 (Linux 0.0.0)]: undefined -> CONNECTED
14 07 2020 06:51:56.187:INFO [HeadlessChrome 84.0.4147 (Linux 0.0.0)]: Connected on socket 1HnLJZHDqfyg-11TAAAA with id 99510655
14 07 2020 06:51:56.189:DEBUG [launcher]: BEING_CAPTURED -> CAPTURED
14 07 2020 06:51:56.189:DEBUG [launcher]: ChromeHeadless (id 99510655) captured in 16.382 secs
14 07 2020 06:51:56.191:DEBUG [HeadlessChrome 84.0.4147 (Linux 0.0.0)]: CONNECTED -> CONFIGURING
[...]
14 07 2020 06:51:57.356:DEBUG [middleware:source-files]: Fetching /_karma_webpack_/vendor.js
14 07 2020 06:51:58.119:DEBUG [middleware:source-files]: Requesting /_karma_webpack_/vendor.js
14 07 2020 06:51:58.128:DEBUG [middleware:source-files]: Fetching /_karma_webpack_/vendor.js
14 07 2020 06:51:59.599:DEBUG [HeadlessChrome 84.0.4147 (Linux 0.0.0)]: Disconnected during run, waiting 2000ms for reconnecting.
14 07 2020 06:51:59.605:DEBUG [HeadlessChrome 84.0.4147 (Linux 0.0.0)]: CONFIGURING -> EXECUTING_DISCONNECTED
14 07 2020 06:52:01.610:WARN [HeadlessChrome 84.0.4147 (Linux 0.0.0)]: Disconnected (0 times)reconnect failed before timeout of 2000ms (transport close)
14 07 2020 06:52:01.610:DEBUG [HeadlessChrome 84.0.4147 (Linux 0.0.0)]: EXECUTING_DISCONNECTED -> DISCONNECTED
HeadlessChrome 84.0.4147 (Linux 0.0.0) ERROR
  Disconnectedreconnect failed before timeout of 2000ms (transport close)

HeadlessChrome 84.0.4147 (Linux 0.0.0) ERROR
  Disconnectedreconnect failed before timeout of 2000ms (transport close)

14 07 2020 06:52:01.683:DEBUG [launcher]: CAPTURED -> BEING_KILLED
14 07 2020 06:52:01.684:DEBUG [launcher]: BEING_KILLED -> BEING_FORCE_KILLED
14 07 2020 06:52:01.709:DEBUG [karma-server]: Run complete, exiting.
14 07 2020 06:52:01.710:DEBUG [launcher]: Disconnecting all browsers
14 07 2020 06:52:01.710:DEBUG [launcher]: BEING_FORCE_KILLED -> BEING_FORCE_KILLED
14 07 2020 06:52:01.736:DEBUG [launcher]: Process ChromeHeadless exited with code null and signal SIGTERM

Following https://github.com/karma-runner/karma-chrome-launcher/issues/137 I'm using Puppeteer:

I've added process.env.CHROME_BIN = require('puppeteer').executablePath() in the karma.conf.js and:

logLevel: config.LOG_DEBUG,
        autoWatch: true,
        browsers: ['ChromeHeadlessNoSandbox'],
        customLaunchers: {
            ChromeHeadlessNoSandbox: {
                base: 'ChromeHeadless',
                flags: ['--no-sandbox']
            }
        },

I don't know what else I can try, any ideas?

0 Answers
Related