Karma + Xvfb + Firefox does not work anymore

747 views Asked by At

I've got a problem with my CI setup. Since a couple of days Firefox doesn't run our Jasmine tests with Karma anymore. But Chrome does - so the error should not depend on the tests themselves. On my development environment it runs as well. I did not change anything on the CI-server (Ubuntu).

What happens: Firefox is connecting to the web-server and establishes a session. But the tests are not executed.

What I already tried: I already changed the timeout. I already restarted the machine (a couple of times). And I already reinstalled firefox.

Do you have an idea, what causes this strange behaviour or how I can debug this?

We are using

karma.conf.js

  module.exports = function(config) {
          config.set({
                  browserNoActivityTimeout: 100000,
                  basePath: 'src/main/webapp/',
                  singleRun: true,
                  // autoWatch: true,
                  logLevel: config.LOG_DEBUG,
                  files: [
                          'assets/libs/jquery/dist/jquery.min.js',
                          'assets/libs/angular/angular.min.js',
                          'assets/libs/angular-mocks/angular-mocks.js',
                          'assets/libs/**/*.min.js',
                          'app/app.js',
                          'app/**/*.js',
                          'app/directives/*/*.html',
                          'app/directives/*/*.js',
                          '../../test/frontend/**/*.js', {
                                  pattern: 'assets/libs/**/*.map',
                                  included: false
                          },
                          'app/views/*.html'
                  ],
                  preprocessors: {
                          'app/views/*.html': 'ng-html2js',
                          'app/directives/*/*.html': 'ng-html2js'
                  },
                  frameworks: ['jasmine'],
                  browsers: [
                          'Firefox'
                  ],
                  plugins: [
                          'karma-chrome-launcher',
                          'karma-firefox-launcher',
                          'karma-safari-launcher',
                          'karma-ie-launcher',
                          'karma-jasmine',
                          'karma-junit-reporter',
                          'karma-ng-html2js-preprocessor'
                  ],
                  reporters: ['progress', 'junit'],
                  junitReporter: {
                          outputFile: '../../../build/test-results/karma-test-results.xml'
                  },
                  ngHtml2JsPreprocessor: {
                          moduleName: 'myc-templates'
                  }
          });
  };

Output of 'xvfb-run karma start'

INFO [karma]: Karma v0.12.37 server started at http://localhost:9876/
INFO [launcher]: Starting browser Firefox
DEBUG [temp-dir]: Creating temp dir at /tmp/karma-70931573
DEBUG [launcher]: firefox http://localhost:9876/?id=70931573 -profile /tmp/karma-70931573 -no-remote
DEBUG [web-server]: serving: /var/lib/jenkins/jobs/MYC/workspace/node_modules/karma/static/client.html
DEBUG [web-server]: serving: /var/lib/jenkins/jobs/MYC/workspace/node_modules/karma/static/karma.js
DEBUG [web-server]: serving: /var/lib/jenkins/jobs/MYC/workspace/node_modules/karma/static/favicon.ico
DEBUG [web-server]: upgrade /socket.io/1/websocket/5wtT2gW7_XuaTRZ3Gctt
DEBUG [karma]: A browser has connected on socket 5wtT2gW7_XuaTRZ3Gctt
INFO [Firefox 38.0.0 (Ubuntu 0.0.0)]: Connected on socket 5wtT2gW7_XuaTRZ3Gctt with id 70931573
DEBUG [launcher]: Firefox (id 70931573) captured in 3.542 secs
DEBUG [web-server]: serving: /var/lib/jenkins/jobs/MYC/workspace/node_modules/karma/static/context.html
DEBUG [Firefox 38.0.0 (Ubuntu 0.0.0)]: Disconnected during run, waiting 2000ms for reconnecting.
WARN [Firefox 38.0.0 (Ubuntu 0.0.0)]: Disconnected (1 times)

DEBUG [karma]: Run complete, exiting.
DEBUG [launcher]: Disconnecting all browsers
DEBUG [reporter.junit]: JUnit results written to "/var/lib/jenkins/jobs/MYC/workspace/build/test-results/karma-test-results.xml".
DEBUG [launcher]: Process Firefox exited with code 0
DEBUG [temp-dir]: Cleaning temp dir /tmp/karma-70931573
npm ERR! weird error 1
npm WARN This failure might be due to the use of legacy binary "node"
npm WARN For further explanations, please read
/usr/share/doc/nodejs/README.Debian

npm ERR! not ok code 0

Any tipps or ideas how to solve this are very much appreciated ;-)

Thanks, Sebastian

0

There are 0 answers