-
Notifications
You must be signed in to change notification settings - Fork 17
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
PhantomJS timeout in Ubuntu #4
Comments
I have no problems running your test on Mac. |
I'm getting the same error, I'm on 12.04 with PhantomJS 1.5. |
Same error on OS X with phantomjs 1.5 |
@axelhzf could you provide me with a barebones setup that fails? I'm on OS X as well and have so far not encountered any problems. |
It was a problem of my test runner configuration, I was using a HtmlReporter. When I delete this reporter it worked. My final configuration is: <script type="text/javascript">
jasmine.getEnv().execute();
</script> |
I ran kcz's test project on OSX Lion, and I get the same error. A project I've been working on is showing the same results. |
@mattd what version of PhantomJS are you using? 1.5? I'm still on v1.4.1 and have no problems. @ariya is there some way we could join forces on this and find out what's going wrong? I can mail you more specifics about how my grunt plugin uses phantomjs |
Hey creynders, thanks for your work on this and it's good to see you on the interwebs again. I noticed on my setup with Windows 7 that Phantom 1.4 and 1.5 both time out but 1.3 works. Using grunt-mocha all three time out. The tasks are so similar I don't know why I see different results. Sorry, I don't have an answer yet either. |
@creynders Yeah, the size of the stack is what had me scratching my head. So I finally got my setup working after many hours. My notes:
Thanks so much for writing this task - I initially thought I'd have to write it myself. ;) |
For reference, the bug report. http://code.google.com/p/phantomjs/issues/detail?id=583 |
@mattd wow, thanks a lot for the hard work! I'll keep an eye on your bug report and see if there is something I do have to do. |
@creynders , thanks for your reminder. But i've got the same error with PhantomJS v1.6 in Ubuntu 10.04. How about other guys? |
Same problem here, PhantomJS 1.5.1, Ubuntu 12.04. Would love to figure this out. |
I have the same problem here in ubuntu. My project work fine in Mac OS but when i run the grunt-jasmine task it always shows me a time out error. :0 |
I get timeout with phantomjs 1.6 on mac os Running "jasmine:all" (jasmine) task PhantomJS timed out, possibly due to an unfinished async spec. Use --force to continue. Aborted due to warnings. |
I had this same issue with both Jasmine and Mocha Grunt tasks using PhantomJS 1.6.1. Here's how I solved it:In your specrunner.html (or whatever you have it named), include this javascript fle: Example: <head>
<!-- Beginning of specrunner.html etc.... -->
<script type="text/javascript" src="lib/jasmine-1.2.0/jasmine.js"></script>
<script type="text/javascript" src="lib/jasmine-1.2.0/jasmine-html.js"></script>
<script type="text/javascript" src="../node_modules/grunt-jasmine-task/tasks/jasmine/jasmine-helper.js"></script>
<!-- Now include spec files here... -->
</head>
<!-- The rest of the document.... --> It completely eliminated all issues for me! |
OMG, you right, this absolutely solved my problem in ubuntu 12.04 ! thank you so much ! |
Sorry, it doesn't work to me in ubuntu 10.04, using nodejs 0.6.15 and phantomjs 1.6.0 ! |
@nhunzaker , thanks so much. You are right. "jasmine-helper.js" is the final solution. |
@chchrist , Timeout error using requireJS doesn't matter with grunt-jasmine-task. It comes from the same reason discussed above. There is a demo with requireJS working well on mac lion and ubuntu 10.04. Don't forget to upgrade phantomjs to 1.6.1 ! |
I'm re-opening this, since I'm not convinced this is the definite solution. I'm afraid i won't be able to fix this 100% until this comes through: http://code.google.com/p/phantomjs/issues/detail?id=539 Maybe I should add @nhunzaker 's solution (thanks for that BTW !!!) to the README though. |
@creynders I think that would be very helpful! It definitely needs to be way more prominent than the line in the docs for grunt-mocha! |
Hmmm, unfortunately this cripples manually run spec runner files. Since the task uses alerts to relay the events from the sandboxed specrunner to grunt, all these alerts are thrown when it's run manually. I suppose it's the same with the grunt-mocha task. |
any update on this issue? I got the same error PhantomJS timed out, possibly due to an unfinished async spec. Use --force to continue. Aborted due to warnings. Using Mac OS X 10.6.8 + phantomjs-1.6.1 + nhunzaker's solution. |
I have a bug that I believe to be similar to this. My SpecRunner.html references a reporter in addition to the helper. When it does, the tests are run before grunt-jasmine-task's reporter is able to pick them up. If I omit my own Reporter, everything works fine. I found a way to solve this, by injecting the helper on the DOMContentLoaded event. Here's a nice workaround to make phantomjs support it: https://gist.github.com/2475509 |
@cburgmer that seems like a really clever solution! One thing I don't understand however is why you use an eval to run the function, wouldn't this work with a direct call to a function too, since the onConsoleMessage handler isn't sandboxed? |
Hi, I didn't look at the code for too long. However the idea is neat and it does work. I could get the task's own reporter to be added before the tests would actually start. My issue is/was that grunt-jasmine-task would only run about half of my tests, as the test run was already underway when the reporter was added. You might want to open another bug report for that. |
Could you guys checkout the code in the WIP branch? |
Hi folks - I'm having the problem as well. I'm unclear if you fixed it. Could you post your specrunner file? |
I've been working to fix a similar problem related to the I'd thought this was due the Jasmine async tests we had been using combined with PhantomJS / Grunt / grunt-contrib-jasmine. But after a LOT of time and investigation I found it was related to the way some of our tests were being cleaned up:
In this instance we were emptying all the elements injected into the DOM for the test. But this doesn't unbind all the JS code which lingers in the background and causes PhantomJS to eventually timeout. This blocked further Grunt tasks from running reports. This is the better technique:
Elements added to the DOM should be removed individually to ensure all the JS associated with them is properly removed and cleaned up, ready for the next spec. This meant we could have a large stack of 77 specs complete without PhantomJS timing out. |
When I try to run grunt jasmine, it failed, due to a timeout, in Ubuntu 10.04 with PhantomJS 1.5.
But the same project worked well in my Mac 10.7.3.
The error message is as follows:
In order to debug, I replaced my project with jasmine demo from official site. The same phenomenon happened again.
Here is the minimized project to indicate problem:
http://kcz.me/test/grunt-jasmine.zip
Maybe the reason comes from phantomJS version. Is there anyone know where I can download PhantomJS 1.3 since that there is no download link in googlecode.
Thanks.
The text was updated successfully, but these errors were encountered: