简体   繁体   English

Firefox/Chrome 未在 2000 毫秒内被杀死,发送 SIGKILL

[英]Firefox/Chrome was not killed in 2000 ms, sending SIGKILL

After running ng test in my local angular(v10) project, all the test cases are executing successfully and the browser is also getting launched and I am able to see the green dots but at the last moment browser is killed with the following warning in my command prompt在我的本地 angular(v10) 项目中运行ng test后,所有测试用例都成功执行,浏览器也启动了,我能够看到绿点,但在最后一刻浏览器被终止,并在我的以下警告命令提示符

在此处输入图像描述

karma.config.js业力.config.js

 module.exports = function (config) { config.set({ basePath: '', frameworks: ['jasmine', '@angular-devkit/build-angular'], plugins: [ 'karma-jasmine', 'karma-firefox-launcher', 'karma-jasmine-html-reporter', 'karma-coverage-istanbul-reporter', '@angular-devkit/build-angular/plugins/karma', 'karma-junit-reporter', 'karma-sonarqube-unit-reporter' ], client: { clearContext: false // leave Jasmine Spec Runner output visible in browser }, coverageIstanbulReporter: { dir: require('path').join(__dirname, './coverage'), reports: [ 'html', 'lcovonly', 'text-summary' ], fixWebpackSourcePaths: true }, sonarQubeUnitReporter: { sonarQubeVersion: 'LATEST', outputFile: 'reports/ut_report.xml', overrideTestDescription: true, testPaths: ['./ng-app'], testFilePattern: '.spec.ts', useBrowserName: false }, junitReporter: { outputDir: 'angular_junit_reporter', // results will be saved as $outputDir/$browserName.xml outputFile: 'karma_unit_test', // if included, results will be saved as $outputDir/$browserName/$outputFile suite: '', // suite will become the package name attribute in xml testsuite element useBrowserName: true, // add browser name to report and classes names nameFormatter: undefined, // function (browser, result) to customize the name attribute in xml testcase element classNameFormatter: undefined, // function (browser, result) to customize the classname attribute in xml testcase element properties: {}, // key value pair of properties to add to the <properties> section of the report xmlVersion: null // use '1' if reporting to be per SonarQube 6.2 XML format }, angularCli: { environment: 'dev', codeCoverage: true }, reporters: config.angularCli && config.angularCli.codeCoverage? ['progress', 'coverage-istanbul']: ['progress', 'kjhtml', 'sonarqubeUnit', 'junit'], port: 9876, colors: true, logLevel: config.LOG_INFO, autoWatch: false, browsers: ['Firefox'], singleRun: true, restartOnFileChange: false, captureTimeout: 210000, browserDisconnectTolerance: 3, browserDisconnectTimeout: 210000, browserNoActivityTimeout: 210000 }); };

What's wrong here?这里出了什么问题?

Change your values as:- autoWatch: true, singleRun: false,将您的值更改为:- autoWatch:true,singleRun:false,

Optional change, it may or may not required restartOnFileChange: true可选更改,可能需要也可能不需要 restartOnFileChange: true

Remove space before colon:- browserDisconnectTimeout: 210000, browserNoActivityTimeout: 210000删除冒号前的空格:- browserDisconnectTimeout: 210000, browserNoActivityTimeout: 210000

For me it works, after running the test with watch true.对我来说它有效,在用 watch true 运行测试后。

"test": "ng test --code-coverage --watch=true"

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM