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

Fix karma hanging after execution #14

Closed
wants to merge 4 commits into from
Closed

Fix karma hanging after execution #14

wants to merge 4 commits into from

Conversation

tatablack
Copy link

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
Copy link

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

@tatablack
Copy link
Author

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
Copy link
Contributor

j0tunn commented Jun 20, 2014

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

@artkoshelev
Copy link

waiting for this PR as well

@Brootux
Copy link

Brootux commented Jul 15, 2014

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
Copy link

Brootux commented Jul 23, 2014

@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
Copy link
Author

@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
Copy link

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

@j0tunn
Copy link
Contributor

j0tunn commented Aug 5, 2014

@Brootux thats a karma issue. Here is my PR for that: karma-runner/karma#1151

@@ -1,7 +1,9 @@
var fs = require('fs');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this line can be safely removed

@@ -1,7 +1,8 @@
var fs = require('fs');
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@j0tunn Thanks, done.

@j0tunn
Copy link
Contributor

j0tunn commented Aug 12, 2014

Hey guys, take a look at #15
It fixes this issue + doesn't hang karma itself on give up (see #14 (comment))

@mtscout6
Copy link
Member

Closing in favor of #15

@mtscout6 mtscout6 closed this Nov 14, 2014
@mtscout6
Copy link
Member

Fix with PR #15 has been pushed with version 0.3.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants