Sinon 1.4.x in IE6-8 uses all resources #182

Closed
malaqueueit opened this Issue Oct 12, 2012 · 8 comments

Comments

Projects
None yet
4 participants
@malaqueueit

When including the sinon-ie-1.4.2 code in IE6-8 the browser uses 100% CPU and memory usage explodes. Browser process must be killed to recover.

Reproduce here: http://s3-eu-west-1.amazonaws.com/queueit-test-jstests/Test/JavascriptClient/TimersTest.htm

@mantoni

This comment has been minimized.

Show comment Hide comment
@mantoni

mantoni Oct 12, 2012

Owner

Hm. The way the sandbox is created seems to be part of the problem. I'm using 1.4.2 with fake timers in IE 8 since the day it was release without issues.
However, with your test case I can confirm the problem.

What I do is either use sinon.test to wrap the test function or this.clock = sinon.useFakeTimers() in my test setUp.

Could you try an alternative approach to see whether this works around the problem in your case?

Owner

mantoni commented Oct 12, 2012

Hm. The way the sandbox is created seems to be part of the problem. I'm using 1.4.2 with fake timers in IE 8 since the day it was release without issues.
However, with your test case I can confirm the problem.

What I do is either use sinon.test to wrap the test function or this.clock = sinon.useFakeTimers() in my test setUp.

Could you try an alternative approach to see whether this works around the problem in your case?

@malaqueueit

This comment has been minimized.

Show comment Hide comment
@malaqueueit

malaqueueit Oct 13, 2012

I'm sorry, it has nothing to do with timers (I just assumed that was the case). I have removed everything but the sinon-1.4.2 reference, and the problem is in fact still there in IE 6-8. So it must be something in the main sinon library.

http://s3-eu-west-1.amazonaws.com/queueit-test-jstests/Test/JavascriptClient/SinonTest.htm

I'm sorry, it has nothing to do with timers (I just assumed that was the case). I have removed everything but the sinon-1.4.2 reference, and the problem is in fact still there in IE 6-8. So it must be something in the main sinon library.

http://s3-eu-west-1.amazonaws.com/queueit-test-jstests/Test/JavascriptClient/SinonTest.htm

@malaqueueit

This comment has been minimized.

Show comment Hide comment
@malaqueueit

malaqueueit Oct 13, 2012

The bug is introduced in v 1.4.0 (I tested 1.4.0 and shows the same symptoms). Using 1.3.4 everything works as expected.

The bug is introduced in v 1.4.0 (I tested 1.4.0 and shows the same symptoms). Using 1.3.4 everything works as expected.

@cjohansen

This comment has been minimized.

Show comment Hide comment
@cjohansen

cjohansen Oct 15, 2012

Contributor

Simply loading the file is enough to cause havoc??

Contributor

cjohansen commented Oct 15, 2012

Simply loading the file is enough to cause havoc??

@mantoni

This comment has been minimized.

Show comment Hide comment
@mantoni

mantoni Oct 15, 2012

Owner

Yes, I can confirm that. It happens here https://github.com/cjohansen/Sinon.JS/blob/master/lib/sinon/stub.js#L331

The problem is that this patch is not in 1.4.2: fca5648

So the good news is that it's already fixed.

Owner

mantoni commented Oct 15, 2012

Yes, I can confirm that. It happens here https://github.com/cjohansen/Sinon.JS/blob/master/lib/sinon/stub.js#L331

The problem is that this patch is not in 1.4.2: fca5648

So the good news is that it's already fixed.

@cjohansen

This comment has been minimized.

Show comment Hide comment
@cjohansen

cjohansen Oct 15, 2012

Contributor

Ah, right. Time to cut a new release then. Will get it out in a day or two.

Contributor

cjohansen commented Oct 15, 2012

Ah, right. Time to cut a new release then. Will get it out in a day or two.

@gtothesquare

This comment has been minimized.

Show comment Hide comment
@gtothesquare

gtothesquare Mar 6, 2014

Contributor

Seems this issue should be closed.

Contributor

gtothesquare commented Mar 6, 2014

Seems this issue should be closed.

@mantoni

This comment has been minimized.

Show comment Hide comment
@mantoni

mantoni Mar 6, 2014

Owner

Oh boy, yes indeed!

Owner

mantoni commented Mar 6, 2014

Oh boy, yes indeed!

@mantoni mantoni closed this Mar 6, 2014

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