I've been encountering a disconnect error while attempting to run Angular test cases. With over 1500 test cases written, it appears that the sheer volume may be causing this issue. Is there a way to resolve the disconnect error when running such a large number of test cases?
Here is the specific error message I receive during execution:
26 02 2021 10:36:47.160:DEBUG [Chrome 88.0.4324.150 (Linux x86_64)]: Disconnected during run, waiting 910000ms for reconnecting.
26 02 2021 10:36:47.160:DEBUG [Chrome 88.0.4324.150 (Linux x86_64)]: EXECUTING -> EXECUTING_DISCONNECTED
26 02 2021 10:51:57.169:WARN [Chrome 88.0.4324.150 (Linux x86_64)]: Disconnected (0 times)reconnect failed before timeout of 910000ms (ping timeout)
26 02 2021 10:51:57.170:DEBUG [Chrome 88.0.4324.150 (Linux x86_64)]: EXECUTING_DISCONNECTED -> DISCONNECTED
I have attempted to increase the wait time but to no avail.
The command I used to run the tests was:
ng test --code-coverage --watch=false --browsers=Chrome
Below is my Karma configuration file:
// 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-istanbul-reporter'),
require('@angular-devkit/build-angular/plugins/karma'),
],
client: {
config: {
browserConsoleLogOptions: true,
},
captureConsole: true,
mocha: {
bail: true
},
clearContext: false // leave Jasmine Spec Runner output visible in browser
},
coverageIstanbulReporter: {
dir: require('path').join(__dirname, '../coverage'),
reports: ['html', 'lcovonly'],
fixWebpackSourcePaths: true
},
reporters: ['progress', 'kjhtml'],
port: 9876,
colors: true,
logLevel: config.LOG_DEBUG,
autoWatch: true,
browsers: ['Chrome'],
captureTimeout: 210000,
browserDisconnectTolerance: 3,
browserDisconnectTimeout : 910000,
browserNoActivityTimeout : 910000,
singleRun: false
});
};
If anyone has a solution for executing a large number of test cases in an Angular application, I would greatly appreciate your help. Thank you!