Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

uncaughtException after a Protractor run

After upgrading to Protractor 4.0.0 and adjusting the config because of the breaking changes, we finally have our tests launching.

Now, the problem is that after a test run it fails with:

[09:52:22] E/launcher - "process.on('uncaughtException'" error, see launcher
[09:52:22] E/launcher - Process exited with error code 199

How to debug this problem and understand what is causing it?


Tried to run Protractor in "troubleshoot" mode:

$ protractor config/local.conf.js --troubleshoot

but got exactly the same output with no details about the error.

like image 802
alecxe Avatar asked Jul 15 '16 13:07

alecxe


2 Answers

This is currently being fixed and there should be a hot fix out soon. The quick fix (before the hot fix is released) is to change the code in your node_modules or revert to 3.3.0.

Edit node_modules/protractor/built/launcher.js replace the uncaughtException at line 168 with:

    process.on('uncaughtException', function (e) {
    var errorCode = exitCodes_1.ErrorHandler.parseError(e);
    if (errorCode) {
        var protractorError = e;
        exitCodes_1.ProtractorError.log(logger, errorCode, protractorError.message, protractorError.stack);
        process.exit(errorCode);
    }
    else {
        logger.error(e.message);
        logger.error(e.stack);
        process.exit(exitCodes_1.ProtractorError.CODE);
    }
});
like image 157
cnishina Avatar answered Sep 20 '22 19:09

cnishina


Upgrading to protractor 4.0.10 seems to solve it.

There were several fixes from 4.0.0 to 4.0.10 in the launcher. See changelog: https://github.com/angular/protractor/blob/master/CHANGELOG.md

like image 43
Elad Tabak Avatar answered Sep 23 '22 19:09

Elad Tabak