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

Cannot start ChromeHeadless 128, 129, 130, 131 #28881

Open
1 task
sysmat opened this issue Nov 16, 2024 · 0 comments
Open
1 task

Cannot start ChromeHeadless 128, 129, 130, 131 #28881

sysmat opened this issue Nov 16, 2024 · 0 comments

Comments

@sysmat
Copy link

sysmat commented Nov 16, 2024

Command

test

Is this a regression?

  • Yes, this behavior used to work in the previous version

The previous version in which this bug was not present was

No response

Description

  • deps
"karma": "~6.4.4",
    "karma-chrome-launcher": "~3.2.0",
    "karma-firefox-launcher": "^2.1.3",
    "karma-coverage": "~2.2.1",
    "karma-jasmine": "~5.1.0",
    "karma-jasmine-html-reporter": "^2.1.0",
    "karma-junit-reporter": "^2.0.1",
    "karma-spec-reporter": "0.0.36",

Minimal Reproduction

  • npm script
"test": "ng test --no-watch --no-progress --browsers=ChromeHeadlessCI --code-coverage",
  • karma conf
// Karma configuration file, see link for more information
// https://karma-runner.github.io/1.0/config/configuration-file.html

module.exports = function (config) {
  config.set({
    basePath: '',
    frameworks: ['jasmine', '@angular-devkit/build-angular'],
    plugins: [
      require('karma-jasmine'),
      require('karma-chrome-launcher'),
      require('karma-firefox-launcher'),
      require('karma-jasmine-html-reporter'),
      require('karma-coverage'),
      require('karma-spec-reporter'),
      require('@angular-devkit/build-angular/plugins/karma'),
      require('karma-junit-reporter')
    ],
    client: {
      clearContext: false // leave Jasmine Spec Runner output visible in browser
    },
    coverageReporter: {
      dir: './coverage',
      reporters: [
        { type: 'html', subdir: 'report-html' },
        { type: 'lcov', subdir: 'report-lcov' }
      ]
    },
    reporters: ['kjhtml', 'spec', 'junit'],
    junitReporter: {
      outputDir: './coverage'
    },
    port: 9876,
    colors: true,
    browserDisconnectTimeout: 50000,
    browserDisconnectTolerance: 3,
    browserNoActivityTimeout: 60000,
    logLevel: config.LOG_INFO,
    autoWatch: true,
    browsers: ['Chrome', 'Firefox'],
    customLaunchers: {
      ChromeHeadlessCI: {
        base: 'ChromeHeadless',
        flags: [          
          '--no-sandbox',
          '--disable-web-security',
          '--disable-gpu',
          '--js-flags=--max-old-space-size=8196'
        ]
      },
      FirefoxHeadless: {
        base: 'Firefox',
        flags: ['-headless']        
      },
    },
    singleRun: false
  });
};
  • angular json
"test": {
          "builder": "@angular-devkit/build-angular:karma",
          "options": {
            "main": "src/test.ts",
            "polyfills": [
              "zone.js",
              "zone.js/testing",
              "@angular/localize/init"
            ],
            "tsConfig": "tsconfig.spec.json",
            "karmaConfig": "karma.conf.js",
            "styles": [
              "src/styles.css"
            ],
            "scripts": [],
            "assets": [
              "src/favicon.ico",
              "src/assets",
              "src/manifest.webmanifest"
            ]
          }
        },
  • running test npm run test

Exception or Error

> ng test --no-watch --no-progress --browsers=ChromeHeadlessCI --code-coverage

�[32m15 11 2024 13:53:09.600:INFO [karma-server]: �[39mKarma v6.4.4 server started at http://localhost:9876/
�[32m15 11 2024 13:53:09.603:INFO [launcher]: �[39mLaunching browsers ChromeHeadlessCI with concurrency unlimited
�[32m15 11 2024 13:53:09.628:INFO [launcher]: �[39mStarting browser ChromeHeadless
�[91m15 11 2024 13:53:09.792:ERROR [launcher]: �[39mCannot start ChromeHeadless
    
�[91m15 11 2024 13:53:09.792:ERROR [launcher]: �[39mChromeHeadless stdout: 
�[91m15 11 2024 13:53:09.792:ERROR [launcher]: �[39mChromeHeadless stderr: 
�[32m15 11 2024 13:53:09.794:INFO [launcher]: �[39mTrying to start ChromeHeadless again (1/2).
�[91m15 11 2024 13:53:09.920:ERROR [launcher]: �[39mCannot start ChromeHeadless
    
�[91m15 11 2024 13:53:09.920:ERROR [launcher]: �[39mChromeHeadless stdout: 
�[91m15 11 2024 13:53:09.921:ERROR [launcher]: �[39mChromeHeadless stderr: 
�[32m15 11 2024 13:53:09.922:INFO [launcher]: �[39mTrying to start ChromeHeadless again (2/2).
�[91m15 11 2024 13:53:10.052:ERROR [launcher]: �[39mCannot start ChromeHeadless
    
�[91m15 11 2024 13:53:10.052:ERROR [launcher]: �[39mChromeHeadless stdout: 
�[91m15 11 2024 13:53:10.052:ERROR [launcher]: �[39mChromeHeadless stderr: 
�[91m15 11 2024 13:53:10.053:ERROR [launcher]: �[39mChromeHeadless failed 2 times (cannot start). Giving up.

Your Environment

Angular CLI: 18.2.12
Node: 22.11.0
Package Manager: npm 10.9.0
OS: win32 x64

Angular: 18.2.12
... animations, cli, common, compiler, compiler-cli, core, forms
... language-service, localize, platform-browser
... platform-browser-dynamic, router, service-worker

Package                         Version
---------------------------------------------------------
@angular-devkit/architect       0.1802.12
@angular-devkit/build-angular   18.2.12
@angular-devkit/core            18.2.12
@angular-devkit/schematics      18.2.12
@schematics/angular             18.2.12

Anything else relevant?

npm run test it works on Chrome 127

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