karma-runner / karma-webdriver-launcher

A plugin for Karma. Launch any browser with WebDriver.
MIT License
66 stars 40 forks source link

Fix karma hanging after execution #14

Closed tatablack closed 10 years ago

tatablack commented 10 years ago

While trying to use this launcher to execute tests on browsers from a Selenium Grid, I noticed that I had intermittent errors from the grid (browser timeouts, or "Failed to navigate" errors). In those cases, Karma would hang just after this launcher printed Killed Karma test.

These commits change the WD.js invocation style, and solve the issue. Besides, I made sure that the (already existing) Launcher retry mechanism is actually triggered in case of timeouts.

jonrsawyer commented 10 years ago

What is the status of this pull request? I am running into this issue also.

tatablack commented 10 years ago

While waiting, I decided to try and create a similar launcher, based on a different WebDriver implementation (this one uses WD.js, I chose WebdriverJS), to see if that improved things.

Results seem to be promising. I'm not finished yet, but it works (I'm using it) and I would welcome some feedback. You can find it here:

https://github.com/tatablack/karma-webdriverjs-launcher

j0tunn commented 10 years ago

@aparkinson what about this PR? I'm running into the same issue. Hang after killing by timeout. /cc @arikon @scff @Coltspb

artkoshelev commented 10 years ago

waiting for this PR as well

Brootux commented 10 years ago

Same problem here!

The launcher detects a timeout after 60 seconds, kills the browser but does not restart it. After that the launcher does not end its task and runns forever!

Brootux commented 10 years ago

@tatablack Ive patched now your first two commits (Make sure..., Switch WD.js...) into my local installation. The restart of the browser is working now but after 3 retries it correctly says

ERROR [launcher]: firefox via Remote WebDriver failed 2 times (timeout). Giving up.

But then it will stay in a endless waiting state like before. Any ideas?

Maybe ill try your karma-webdriverjs-launcher later.

tatablack commented 10 years ago

@Brootux You're right, and I'm afraid you'll see the same behaviour with my alternative launcher. As a workaround, in there I increased (to 5) the number of retries, which works well enough for me, since usually the failure is due to Selenium Grid misbehaving when asked for a node (and asking again helps). However, if there's really an issue and all the retries fail, it will hang.

I haven't had time recently to keep investigating; if I do, I'll make sure to keep this thread updated.

just-boris commented 10 years ago

Vote for merge. This commit provides better logging, but does nothing worse. Summoning someone @karma-runner, why you don't merge it?

j0tunn commented 10 years ago

@Brootux thats a karma issue. Here is my PR for that: https://github.com/karma-runner/karma/pull/1151

j0tunn commented 10 years ago

Hey guys, take a look at #15 It fixes this issue + doesn't hang karma itself on give up (see https://github.com/karma-runner/karma-webdriver-launcher/pull/14#issuecomment-49858464)

mtscout6 commented 10 years ago

Closing in favor of #15

mtscout6 commented 9 years ago

Fix with PR #15 has been pushed with version 0.3.0