Assertion failed : (0) at the end of karma execution
See original GitHub issueIssue
Hello, I using Karma + Webpack for running my unit tests and karma always display an error after testing and just before closing Chrome (or ChromeHeadless).
Error
The error is : Assertion failed: (0), function uv_close, file …/deps/uv/src/unix/core.c, line 187. [1] 18461 abort npm run test-debug
Below a copy of my terminal
TOTAL: 87 SUCCESS 15 05 2020 15:35:04.564:DEBUG [karma-server]: Run complete, exiting. 15 05 2020 15:35:04.564:DEBUG [launcher]: Disconnecting all browsers 15 05 2020 15:35:04.564:DEBUG [launcher]: BEING_FORCE_KILLED -> BEING_FORCE_KILLED Assertion failed: (0), function uv_close, file ../deps/uv/src/unix/core.c, line 187. [1] 18552 abort npm run test-debug
Software and hardware
The issue still appear on :
- local environment (mac os Catalina 10.15.4) running the npm script
- local environment running the maven script (java project+react) to build the entire project. Maven will failed because of the issue
- gitlab CI running the maven script (linux server)
Karma config
Below my karma config : `module.exports = function (config) { config.set({ // base path that will be used to resolve all patterns (eg. files, exclude) basePath: ‘…/…/…/’,
// frameworks to use
// available frameworks: https://npmjs.org/browse/keyword/karma-adapter
frameworks: ['requirejs', 'jasmine'],
// list of files / patterns to load in the browser
files: [
//Static resources
tests + 'test-main.js', // Will load ebxUI bundles..
//Unit test here
{pattern: tests + 'src/**/*.tsx', included: false},
{pattern: tests + 'src/**/*.ts', included: false},
//EBX lib
{pattern: ebxUI + "js/**/*", included: false},
{pattern: libTest + "/**/*", included: false}
],
// list of files to exclude
exclude: [],
// // Redirect access to resources
// proxies: {
// '/images/': 'http://localhost:11180/ebx-ui/images/'
// },
// preprocess matching files before serving them to the browser
// available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor
preprocessors: {
//TODO coverage is not useful currently, try to do like : https://github.com/mcliment/typescript-karma-webpack-coverage-sample
'project-folder/src/test/src/react/**/*.ts*': ['webpack'],
},
webpack: webpackConfig,
// test results reporter to use
// possible values: 'dots', 'progress'
// available reporters: https://npmjs.org/browse/keyword/karma-reporter
reporters: ['progress', 'coverage'],
// optionally, configure the reporter
coverageReporter: {
type: 'html',
dir: tests + 'coverage/'
},
// web server port
port: 9876,
// enable / disable colors in the output (reporters and logs)
colors: true,
// level of logging
// possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG
logLevel: config.LOG_INFO,
// enable / disable watching file and executing tests whenever any file changes
autoWatch: false,
// start these browsers
// available browser launchers: https://npmjs.org/browse/keyword/karma-launcher
browsers: ['Chrome',"ChromeCustom"],
// Continuous Integration mode
// if true, Karma captures browsers, runs the tests and exits
singleRun: false,
// Concurrency level
// how many browser should be started simultaneous
concurrency: "Infinity",
// Prevent karma to crash for empty
// tests
failOnEmptyTestSuite: false,
// Set karma timeout
browserNoActivityTimeout : 60000,
processKillTimeout:30000,
// Custom karma execution for CI
customLaunchers: {
ChromeCustom: {
base: 'ChromeHeadless',
// We must disable the Chrome sandbox when running Chrome inside Docker (Chrome's sandbox needs
// more permissions than Docker allows by default)
flags: isDocker ? ['--no-sandbox'] : []
}
}
})`
package.json file
More info
Sometimes (it’s rare) the script end well and I don’t have the issue.
NPM and node version
node: v12.16.3 npm:6.14.4
Issue Analytics
- State:
- Created 3 years ago
- Comments:8
Top GitHub Comments
I just test with your fix and I still have the same issue.
Assertion failed: (0), function uv_close, file ../deps/uv/src/unix/core.c, line 187.
Thank you for your help.The last version of karma and karm-webpack resolve this issue ! Thank you.