joeljeske / karma-parallel

A Karma JS Framework to support sharding tests to run in parallel across multiple browsers

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Random test failures during CI process

mgmaster24 opened this issue · comments

  • **I'm submitting a ... **

    • bug report
    • feature request
  • Do you want to request a feature or report a bug?
    Not sure this is a bug, just need some information.

  • What is the current behavior?
    When running a jasmine test suite in Amazon CodeBuild we get random failures. There are no specific test failures, but the HeadlessChrome instance does disconnect midway through the test suite. This does not happen when running the test from a developer machine.

HeadlessChrome 77.0.3865 (Linux 0.0.0) ERROR

623 | Disconnected, because no message in 30000 ms.
624 | ·[1A·[2K·[1A·[2K·[1A·[2KHeadlessChrome 77.0.3865 (Linux 0.0.0) ERROR
625 | Disconnected, because no message in 30000 ms.
626 | HeadlessChrome 77.0.3865 (Linux 0.0.0): Executed 95 of 95 DISCONNECTED (2 mins 16.668 secs / 1 min 46.294 secs)
627 | HeadlessChrome 77.0.3865 (Linux 0.0.0): Executed 117 of 117 SUCCESS (1 min 38.204 secs / 1 min 37.86 secs)
628 | HeadlessChrome 77.0.3865 (Linux 0.0.0): Executed 100 of 147 SUCCESS (0 secs / 2 mins 12.715 secs)
629 | HeadlessChrome 77.0.3865 (Linux 0.0.0) ERROR

  • If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem

  • What is the expected behavior?

  • Please tell us about your environment:

  • version: 2.0.0-beta.X
  • Browser: [Chrome 80 ]
  • Language: [TypeScript 3.2.4 ]
  • Other information (e.g. detailed explanation, stacktraces, related issues, suggestions how to fix, links for us to have context, eg. stackoverflow, gitter, etc)

Karma Conf:
module.exports = function(config) {
config.set({
basePath: '',
frameworks: ['parallel', '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'),
require('karma-junit-reporter'),
require('karma-spec-reporter'),
require('karma-parallel')
],
parallelOptions: {
executors: 3, // Defaults to cpu-count - 1
shardStrategy: 'round-robin'
},
client: {
clearContext: false // leave Jasmine Spec Runner output visible in browser
},
coverageIstanbulReporter: {
dir: require('path').join(__dirname, '../coverage'),
reports: ['html', 'lcovonly'],
fixWebpackSourcePaths: true
},
angularCli: {
environment: 'dev'
},
reporters: ['junit', 'coverage-istanbul', 'spec', 'progress', 'kjhtml'],
specReporter: {
suppressSkipped: true
},
junitReporter: {
outputDir: './junitReport',
suite: '',
useBrowserName: false
},
port: 9876,
colors: true,
logLevel: config.LOG_INFO,
autoWatch: true,
browsers: ['Chrome', 'HeadlessChrome'],
customLaunchers: {
HeadlessChrome: {
base: 'Chrome',
flags: ['--headless', '--disable-gpu', '--remote-debugging-port=9222', '--no-sandbox']
}
},
singleRun: false,
failOnSkippedTests: true
});
};