Infinitive loop #275

Closed
plusgut opened this Issue Aug 28, 2012 · 7 comments

Comments

Projects
None yet
5 participants
@plusgut

plusgut commented Aug 28, 2012

I'm working with phantomjs and with certain conditions (don't know yet how to reproduce it), jasmine gets into a infinitive loop.

RangeError: Maximum call stack size exceeded.

http://localhost/jasmine.js:1685
http://localhost/jasmine.js:1685
http://localhost/jasmine.js:1685
http://localhost/jasmine.js:1685

@infews

This comment has been minimized.

Show comment Hide comment
@infews

infews Sep 2, 2012

Contributor

Are you sumbitting a form under test? Form submits force a reload and get you into a loop. Try spying on your form submit and see if that stabilizes your suite.

Contributor

infews commented Sep 2, 2012

Are you sumbitting a form under test? Form submits force a reload and get you into a loop. Try spying on your form submit and see if that stabilizes your suite.

@plusgut

This comment has been minimized.

Show comment Hide comment
@plusgut

plusgut Sep 3, 2012

Nope, i'm just checking if true is false, so no real action happens

plusgut commented Sep 3, 2012

Nope, i'm just checking if true is false, so no real action happens

@infews

This comment has been minimized.

Show comment Hide comment
@infews

infews Sep 6, 2012

Contributor

Can you post a simple example that demonstrates the problem?

Contributor

infews commented Sep 6, 2012

Can you post a simple example that demonstrates the problem?

@timblack1

This comment has been minimized.

Show comment Hide comment
@timblack1

timblack1 Nov 20, 2012

I'm getting a similar error. Did you find a solution?

I'm getting a similar error. Did you find a solution?

@Honroy

This comment has been minimized.

Show comment Hide comment
@Honroy

Honroy Dec 7, 2012

I had the same problem using phantomjs and jasmine. Following the thread at johnbintz/jasmine-headless-webkit#84, I thought I might be having an issue with onPageLoaded in jasmineRunner.js getting called more than once and therefore firing window.onload more than once. So I put in a null check on _cachedWindowLoad:

var _cachedWindowLoad;

    if (!_cachedWindowLoad) {
        _cachedWindowLoad = window.onload;

        if (_cachedWindowLoad) {
            _cachedWindowLoad();
        }
    }

I have not seen that error since I made this change.

Honroy commented Dec 7, 2012

I had the same problem using phantomjs and jasmine. Following the thread at johnbintz/jasmine-headless-webkit#84, I thought I might be having an issue with onPageLoaded in jasmineRunner.js getting called more than once and therefore firing window.onload more than once. So I put in a null check on _cachedWindowLoad:

var _cachedWindowLoad;

    if (!_cachedWindowLoad) {
        _cachedWindowLoad = window.onload;

        if (_cachedWindowLoad) {
            _cachedWindowLoad();
        }
    }

I have not seen that error since I made this change.

@ragaskar

This comment has been minimized.

Show comment Hide comment
@ragaskar

ragaskar Dec 7, 2012

Contributor

OK, sounds like a jasmine-headless-webkit problem. Closing.

Contributor

ragaskar commented Dec 7, 2012

OK, sounds like a jasmine-headless-webkit problem. Closing.

@ragaskar ragaskar closed this Dec 7, 2012

@timblack1

This comment has been minimized.

Show comment Hide comment
@timblack1

timblack1 Dec 7, 2012

What fixed it for me was that I discovered I had been loading Jasmine twice in the same page by accident. So once I made it so Jasmine loaded only once, the error went away.

What fixed it for me was that I discovered I had been loading Jasmine twice in the same page by accident. So once I made it so Jasmine loaded only once, the error went away.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment