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

Process out of memory while waiting on nested promise expect call evaluation #2589

Closed
myartsev opened this issue Oct 7, 2015 · 3 comments
Closed

Comments

@myartsev
Copy link

myartsev commented Oct 7, 2015

Contrived example, but hopefully it's enough to illustrate the problem.

This works just fine:

element.all(by.tagName("someTag")).count().then((num) => {
    browser.refresh().then(() => {
        var elemsAfterRefresh: protractor.ElementArrayFinder = element.all(by.tagName("someTag"));
        elemsAfterRefresh.count().then((count) => {
            console.log(count);
            expect(num).toMatch(count);
        });
    });
});

This fails with the out of memory exception:

element.all(by.tagName("someTag")).count().then((num) => {
    browser.refresh().then(() => {
        var elemsAfterRefresh: protractor.ElementArrayFinder = element.all(by.tagName("someTag"));
        elemsAfterRefresh.count().then((count) => {
            console.log(count);
        });

        expect(num).toMatch(elemsAfterRefresh.count());
    });
});

FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - process out of memory

It appears that something is wrong inside of expect() while evaluating the count() promise.

@sjelin
Copy link
Contributor

sjelin commented Oct 9, 2015

Can I see your config file? I suspect this is a problem with jasmine 1.x

@myartsev
Copy link
Author

Forgot to mention I am not using Selenium, but connecting directly to the Chrome drivers.
Let me know if you need any further info!

var HtmlReporter = require('protractor-html-screenshot-reporter');

exports.config = {
    capabilities: { 'browserName': 'chrome' },
    directConnect: true,
    allScriptsTimeout: 25000,

    jasmineNodeOpts: { showColors: true },

    onPrepare: function () {
        var params = browser.params;

        jasmine.getEnv().addReporter(new HtmlReporter({
            baseDirectory: params.results_folder, takeScreenShotsOnlyForFailedSpecs: true
        }));

        browser.driver.manage().window().maximize();

        ... some more app-specific code to log-in, shouldn't affect protractor at all ...
    }
}

@sjelin
Copy link
Contributor

sjelin commented Oct 13, 2015

Yeah, you're using jasmine 1.x. I suspect this is your problem: angular/jasminewd#35

Upgrading to jasmine 2.x would solve your problem, if that's feasible

@sjelin sjelin closed this as completed Oct 13, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants