karma-runner / karma-ie-launcher

A Karma plugin. Launcher for Internet Explorer.
MIT License
59 stars 23 forks source link

IE11 disconnects after some time #8

Open mgol opened 10 years ago

mgol commented 10 years ago

My unit tests take much longer to run in IE than in Chrome/Firefox (where they take 30-40 seconds). After some time over 2 minutes IE11 gets disconnected:

.WARN [IE 11.0.0 (Windows 7)]: Disconnected

IE 11.0.0 (Windows 7): Executed 5 of 414 (skipped 178) DISCONNECTED (2 mins 30.3 45 secs / 1 min 30.916 secs)
Warning: Task "karma:jenkins" failed. Use --force to continue.

Aborted due to warnings.

This makes it impossible for me to test on IE... Is there anything else that could trigger the disconnection besides the timeout? Any way to troubleshoot it?

EDIT: it seems it's not based on time but on some specific tests. It almost always fails after 181 or 180 tests from 414. There is, however, nothing demanding in these particular tests that wasn't already run in earlier tests due to beforeEach blocks. If I exclude the offending module, tests fail after 9 minutes, near the end.

Why is it so? IMO the total disconnection should never happen. If there is a bug, an error should be thrown instead of just disconnecting from the browser which says nothing about what's wrong.

vojtajina commented 10 years ago

Well, in IE, anything can happen. I did a tons of stuff to make IE (8-10) stable on our Travis + SL, however I didn't have any issues with IE11.

You can try canary Karma (0.11), which has these features. You can configure: browserDisconnectTimeout (in ms, if a browser disconnects, Karma waits this timeout for reconnecting) browserDisconnectTolerance (how many times Karma tries to restart the browser if it disconnects)

Are you using Jasmine? If so, can you try jasmine.DEFAULT_UPDATE_INTERVAL = 0; in some of your files? Then you should be able to track which test does it.

mgol commented 10 years ago

Thanks. Yes, I'm using Jasmine so I'll try it, the browserDisconnectTolerance setting also seems promising. I'm not sure about the timeout since IE11 fails on these tests after non-consistent amount of time, it seems to depend more on specific tests (or set of tests) than on the time itself.

I'll report here with my findings.

BantramFidian commented 4 years ago

There still seem to be problems. We have currently set very lose restrictions on the reconnetion delay and still IE disconnects. In addition I can observe, that if IE reconnects to Karma it will more often that not start running the tests twice afte reconnect (i.e. giving to lines per test) and start the whole testing process from the beginning.

Any ideas where we can investigate further?