Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Chrome hangs on new start #63

Open
AStoker opened this issue Nov 3, 2015 · 8 comments
Open

Chrome hangs on new start #63

AStoker opened this issue Nov 3, 2015 · 8 comments

Comments

@AStoker
Copy link

AStoker commented Nov 3, 2015

When I start karma, it starts up a new Chrome instance (as expected). However, the Chrome instance hangs trying to load the page (eventually prompting me to either kill the tab or wait for it). Karma will time out and try to launch chrome again, before it eventually gives up and shuts down. However, I can copy the link that Karma is trying to open, and paste it in another instance of Chrome, and it loads up just fine.
So it seems that there is something wrong with how karma-chrome-launcher is starting up the Chrome instance.
Karma config:

// Karma configuration
// Generated on Tue Oct 13 2015 10:36:06 GMT-0400 (Eastern Daylight Time)

module.exports = function(config) {
  config.set({

    // base path that will be used to resolve all patterns (eg. files, exclude)
    basePath: 'wwwroot',


    // frameworks to use
    // available frameworks: https://npmjs.org/browse/keyword/karma-adapter
    frameworks: ['jspm','jasmine'],


    jspm: {
        loadFiles: [
            'src/**/*.js',
            'test/**/*.js'
        ],
        paths: {
            '*': '*.js'
        },
    },

    // list of files / patterns to load in the browser
    files: [
        'src/**/*.css'
    ],


    // list of files to exclude
    exclude: [
    ],


    // preprocess matching files before serving them to the browser
    // available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor
    preprocessors: {
        'src/**/*.js': ['babel']
    },
    'babelPreprocessor': {
        options: {
            sourceMap: 'inline',
            modules: 'system',
            moduleIds: false,
            //loose: "all",
            optional: [
              "es7.decorators",
              "es7.classProperties",
              "es7.asyncFunctions",
              "es7.functionBind",
            ]
        }
    },


    // test results reporter to use
    // possible values: 'dots', 'progress'
    // available reporters: https://npmjs.org/browse/keyword/karma-reporter
    reporters: ['progress'],


    // 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: true,


    // start these browsers
    // available browser launchers: https://npmjs.org/browse/keyword/karma-launcher
    browsers: ['Chrome'],


    // Continuous Integration mode
    // if true, Karma captures browsers, runs the tests and exits
    singleRun: false
  })
}

I don't think it's necessarily a problem with Karma, as I can use the Firefox launcher, and it works just fine. However, that could be coincidence...

@ghost
Copy link

ghost commented Nov 4, 2015

+1

@VivekWisdom
Copy link

same issue no solution yet +1

@oising
Copy link

oising commented Mar 3, 2016

yep, my chrome instances open up immediately dead but using chrome stand alone is fine. Any attempt to interact with the "dead" instance of chrome results in dead tabs with the "sad mac" icon (e.g. opening extensions, settings, etc.)

image

@oising
Copy link

oising commented Mar 3, 2016

A little investigation tells me that the node process is launching chrome with a custom --user-data-dir path. When I try to launch chrome with the same command line, e.g.

"C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" --user-data-dir=C:\Users\username\AppData\Local\Temp\karma-43519497 --no-default-browser-check --no-first-run --disable-default-apps --disable-popup-blocking --disable-translate http://localhost:9876/?id=43519497

It crashes with the dead tab, although the data dir is populated with the various initialization data that the browsers dumps there.

When I omit the --user-data-dir statement, the browser instance does NOT crash.

@vdolek
Copy link

vdolek commented May 22, 2017

This happened to me when I was running the command from admin console. When running as current user it works.

@nakah
Copy link

nakah commented Jul 21, 2017

I'm having the same issue and it's not related to administrative permissions.
Did the same test as @oising same results. As soon as the --user-data-dir flag is present, the tab is crashing. I expect it to be a Chome issue instead of Karma

@mmanela
Copy link

mmanela commented Aug 23, 2017

Yes, I am hitting the same issue but it is a chrome-launcher issue not a karma issue I think. I can repro just using https://github.com/GoogleChrome/lighthouse/tree/master/chrome-launcher.

@mmanela
Copy link

mmanela commented Aug 23, 2017

Posted on Chrome-Launcher (GoogleChrome/lighthouse#3099)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants