reggie
reggie

Reputation: 3674

Travis CI - Builds are timing out

My .travis.yml

language: node_js
node_js:
  - "0.12"
before_install:
  - "export DISPLAY=:99.0"
  - "sh -e /etc/init.d/xvfb start"

I have only added a few very simple tests so far (checking that class attributes exist). I can see the tests are executed.

Then, the last few lines in the Travis output are this:

WARN [web-server]: 404: /css/style.min.css?1435068425.642
No output has been received in the last 10 minutes, this potentially indicates a stalled build or something wrong with the build itself.
The build has been terminated

If the tests are running, then the build and dependencies must have been installed already? So why is the process not finishing once all tests are executed?

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: [
        'jasmine',
        'requirejs'
    ],
    // list of files / patterns to load in the browser
    files: [
      {pattern: 'js/vendor/**/*.js', included: false},
      {pattern: 'js/*.js', watched: true, included: false},
      {pattern: 'test/**/*Spec.js', watched: true, included: false},
      {pattern: 'css/**/*.css', included: false},
      'test/test-main.js'
    ],
    // list of files to exclude
    exclude: [
        'test/lib/**/*.js',
        'js/vendor/**/test/*.js', //do not include the vendor tests
        'js/_admin.js'
    ],
    preprocessors: {
    },
    reporters: ['progress'],
    // web server port
    port: 9876,
    // enable / disable colors in the output (reporters and logs)
    colors: true,
    // level of logging
    logLevel: config.LOG_INFO,
    autoWatch: true,
    browsers: ['Firefox'], //'Chrome', 'PhantomJS', 'PhantomJS_custom'
    singleRun: false,
  });//config.set
};//module.exports

test-main.js in folder test:

var allTestFiles = [];
var TEST_REGEXP = /(spec|test)\.js$/i;

Object.keys(window.__karma__.files).forEach(function(file) {
    if (TEST_REGEXP.test(file)) {
        // Normalize paths to RequireJS module names.
        allTestFiles.push(file);
    }
    //console.log('test files:', allTestFiles);
});

require.config({
    baseUrl: '/base',
    paths: {
        'jquery': './js/vendor/jquery/jquery-2.1.4.min',
        'jquery-ui': './js/vendor/jquery-ui-1.11.4.custom/jquery-ui.min',
        'underscore': './js/vendor/underscore/underscore-min',
        'backbone': './js/vendor/backbone/backbone-min',
        'mustache': './js/vendor/mustache/mustache.min',
        'domReady': './js/vendor/requirejs/plugins/domReady/domReady',
        'text': './js/vendor/requirejs/plugins/text/text',
        //------------------------------------
        //custom requireJS application modules
        'my': './js/my',
        'my-CSS': './js/my-CSS'
    },
    shim: {
        'underscore': {
            exports: '_'
        }
    },
    deps: allTestFiles,
    callback: window.__karma__.start
});

The my-CSS module loads the css like this:

//custom requireJS module to hold the crowdUI class
define(["my"], function (my) { //prerequisites
    'use strict';
    //load the CSS definitions
    document.head.appendChild(
        my.createElement('link', {
            attribute: {
                id: 'my-CSS',
                href: './css/style.min.css?' + crowdUI.TIMESTAMP,
                rel: 'stylesheet',
                type: 'text/css'
            }
        })
    );

});

Upvotes: 2

Views: 2002

Answers (1)

espinchi
espinchi

Reputation: 9212

If the issue is just that your task requires more than 10 minutes during which it produces no output, the fix is simple: prepend your command with travis_wait.

For instance travis_wait myCommand instead of just myCommand.

Upvotes: 4

Related Questions