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

Angular 14 karma gets stuck after executing tests on Azure Devops Linux Build Agents using chrome Headless resulting in stuck pipeline #3817

Open
ghost opened this issue Sep 22, 2022 · 0 comments

Comments

@ghost
Copy link

ghost commented Sep 22, 2022

Angular 14 karma gets stuck after executing tests on Azure Devops Linux Build Agents using chrome Headless resulting in stuck pipeline. This issue only seems to happen when running chrome headless on a linux based azure devops agent but not on windows.

Karma versions and dependency versions:
"karma": "~6.4.1",
"karma-chrome-launcher": "~3.1.1",
"karma-coverage": "~2.2.0",
"karma-jasmine": "~5.1.0",
"karma-jasmine-html-reporter": "~2.0.0",

Karma configuration:
// 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-jasmine-html-reporter'),
require('karma-coverage'),
require('@angular-devkit/build-angular/plugins/karma')
],
client: {
jasmine: {
verboseDeprecations: true
// you can add configuration options for Jasmine here
// the possible options are listed at https://jasmine.github.io/api/edge/Configuration.html
// for example, you can disable the random execution with random: false
// or set a specific seed with seed: 4321
},
clearContext: false // leave Jasmine Spec Runner output visible in browser
},
jasmineHtmlReporter: {
suppressAll: true // removes the duplicated traces
},
coverageReporter: {
dir: require('path').join(__dirname, './coverage/libraries'),
subdir: '.',
reporters: [{ type: 'html' }, { type: 'text-summary' }]
},
reporters: ['progress', 'kjhtml'],
port: 9876,
colors: true,
logLevel: config.LOG_INFO,
autoWatch: false,
browsers: ['Chrome'],
singleRun: true,
captureTimeout: 6000,
restartOnFileChange: true
});
};

In all runs the tests seem to finish but the pipeline hangs:

LOG: 'sidenavtabs=', []
Chrome Headless 103.0.5060.134 (Linux x86_64): Executed 15 of 49 (skipped 1) SUCCESS (0 secs / 0.335 secs)
Chrome Headless 103.0.5060.134 (Linux x86_64): Executed 16 of 49 (skipped 1) SUCCESS (0 secs / 0.343 secs)
Chrome Headless 103.0.5060.134 (Linux x86_64): Executed 17 of 49 (skipped 1) SUCCESS (0 secs / 0.346 secs)
Chrome Headless 103.0.5060.134 (Linux x86_64): Executed 18 of 49 (skipped 1) SUCCESS (0 secs / 0.35 secs)
Chrome Headless 103.0.5060.134 (Linux x86_64): Executed 19 of 49 (skipped 1) SUCCESS (0 secs / 0.351 secs)
Chrome Headless 103.0.5060.134 (Linux x86_64): Executed 20 of 49 (skipped 1) SUCCESS (0 secs / 0.353 secs)
Chrome Headless 103.0.5060.134 (Linux x86_64): Executed 21 of 49 (skipped 1) SUCCESS (0 secs / 0.356 secs)
Chrome Headless 103.0.5060.134 (Linux x86_64): Executed 22 of 49 (skipped 1) SUCCESS (0 secs / 0.362 secs)
Chrome Headless 103.0.5060.134 (Linux x86_64): Executed 23 of 49 (skipped 2) SUCCESS (0 secs / 0.364 secs)
Chrome Headless 103.0.5060.134 (Linux x86_64): Executed 24 of 49 (skipped 3) SUCCESS (0 secs / 0.372 secs)
Chrome Headless 103.0.5060.134 (Linux x86_64): Executed 25 of 49 (skipped 3) SUCCESS (0 secs / 0.375 secs)
Chrome Headless 103.0.5060.134 (Linux x86_64): Executed 26 of 49 (skipped 3) SUCCESS (0 secs / 0.377 secs)
Chrome Headless 103.0.5060.134 (Linux x86_64): Executed 27 of 49 (skipped 3) SUCCESS (0 secs / 0.377 secs)
Chrome Headless 103.0.5060.134 (Linux x86_64): Executed 28 of 49 (skipped 3) SUCCESS (0 secs / 0.38 secs)
Chrome Headless 103.0.5060.134 (Linux x86_64): Executed 29 of 49 (skipped 3) SUCCESS (0 secs / 0.383 secs)
Chrome Headless 103.0.5060.134 (Linux x86_64): Executed 30 of 49 (skipped 3) SUCCESS (0 secs / 0.389 secs)
Chrome Headless 103.0.5060.134 (Linux x86_64): Executed 31 of 49 (skipped 3) SUCCESS (0 secs / 0.395 secs)
LOG: []
Chrome Headless 103.0.5060.134 (Linux x86_64): Executed 31 of 49 (skipped 3) SUCCESS (0 secs / 0.395 secs)
LOG: []
Chrome Headless 103.0.5060.134 (Linux x86_64): Executed 32 of 49 (skipped 3) SUCCESS (0 secs / 0.399 secs)
Chrome Headless 103.0.5060.134 (Linux x86_64): Executed 33 of 49 (skipped 3) SUCCESS (0 secs / 0.406 secs)
Chrome Headless 103.0.5060.134 (Linux x86_64): Executed 34 of 49 (skipped 3) SUCCESS (0 secs / 0.409 secs)
Chrome Headless 103.0.5060.134 (Linux x86_64): Executed 35 of 49 (skipped 3) SUCCESS (0 secs / 0.415 secs)
Chrome Headless 103.0.5060.134 (Linux x86_64): Executed 36 of 49 (skipped 3) SUCCESS (0 secs / 0.424 secs)
Chrome Headless 103.0.5060.134 (Linux x86_64): Executed 37 of 49 (skipped 3) SUCCESS (0 secs / 0.427 secs)
Chrome Headless 103.0.5060.134 (Linux x86_64): Executed 38 of 49 (skipped 3) SUCCESS (0 secs / 0.438 secs)
Chrome Headless 103.0.5060.134 (Linux x86_64): Executed 39 of 49 (skipped 3) SUCCESS (0 secs / 0.448 secs)
Chrome Headless 103.0.5060.134 (Linux x86_64): Executed 40 of 49 (skipped 3) SUCCESS (0 secs / 0.453 secs)
Chrome Headless 103.0.5060.134 (Linux x86_64): Executed 41 of 49 (skipped 3) SUCCESS (0 secs / 0.46 secs)
Chrome Headless 103.0.5060.134 (Linux x86_64): Executed 42 of 49 (skipped 3) SUCCESS (0 secs / 0.462 secs)
Chrome Headless 103.0.5060.134 (Linux x86_64): Executed 43 of 49 (skipped 3) SUCCESS (0 secs / 0.469 secs)
Chrome Headless 103.0.5060.134 (Linux x86_64): Executed 44 of 49 (skipped 4) SUCCESS (0 secs / 0.479 secs)
Chrome Headless 103.0.5060.134 (Linux x86_64): Executed 45 of 49 (skipped 4) SUCCESS (0 secs / 0.485 secs)
Chrome Headless 103.0.5060.134 (Linux x86_64): Executed 45 of 49 (skipped 4) SUCCESS (0.007 secs / 0.485 secs)
TOTAL: 45 SUCCESS

If we run it directly on the linux host it seems to exit fine, this only seems to happen when run inside a pipeline.

We have reached out to Microsoft who have recreated the issue but claim it is an issue wiht karma hanging rather than an Azure DevOps issue:

"We have update from PG. This appears to be a 3rd party issue and not a devops issue.

  • Confirmed problem happens hosted or self hosted
  • There are reports of npm test with Karma 14 hanging
    https://github.com/karma-runner/karma/issues/3803
  • "kill -9 npm" will allow the pipeline to proceed
  • This proves that the issue is not on the devops side and is due to the 3rd party not giving our agents the command to stop the script which is also common on other platform agents.

We suggest reaching out to the karma team to resolve this."

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

0 participants