-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
random DISCONNECTED messages from PhantomJS #598
Comments
I believe there was some issue with Node + socket, it should be fixed in Node 0.10.12, can you try to udpate node ? |
We are having this too, with these versions:
|
same issue with the latest node. |
Same problem with: Phantom 1.9.1 |
same problem for me, Node: v0.10.21 |
Same here with:
|
Can you guys try to debug it a bit to see what's going on in the browser? |
It might be related to #558. |
I keep having this problem too - everything works fine in Chrome, but switching to PhantomJS seems to result in unpredictable behavior. I have tried configuring each of the different transport options individually, but typically get the same behavior. OS: Mac OS X - 10.9.2 (Mavericks) Here is the output (the test that fails varies from run to run): WARN [PhantomJS 1.9.7 (Mac OS X)]: Disconnected (1 times), because no message in 10000 ms. PhantomJS 1.9.7 (Mac OS X): Executed 108 of 559 DISCONNECTED (30.895 secs / 21.301 secs) |
I have it configured for debugging... is there any particular information that would help? I don't seem to get much info from the Network or Timeline tabs. I can turn on profiling, but I'm not sure how much that will tell us... actually it seems like the disconnect causes Phantom to shutdown before the profiling information is returned. Do you have any suggestions on good places to put breakpoints maybe? |
Same Problem here: PhantomJS 1.9.7 (Linux): Executed 99 of 304 SUCCESS (0 secs / 0.567 secs) This problem occurs randomly, sometimes everything is fine, sometime it breaks. But when it breaks, it breaks always at test 99. Karma 0.12.4 |
I'm getting this on other browsers than phantomJS on karma 0.12.16. |
I have multiple configurations for multiple browsers that work when I have
This is happening in PhantomJS, Chrome, and Firefox. |
I had a similar problem on my continuous integration server at work. I found out that the machine was so busy that it was in fact timing out for real. I set the timeout to 30 sec and that solved the problem. I'm not saying that this is a final solution for you guys but if you increase the timeout and and it stops failing, we might have more information to investigate. |
The I dug around the docs looking for other timeout options, but I couldn't find any. Is there maybe another hidden option for a "wait for execution to start" timeout? |
There are 4 timeouts, from
I dont remember which one I changed but |
Yup. That did the trick! I should have thought to check the source. Thanks for your help! |
Sure! |
Works for me too 👍 |
For me too 👍 |
It solved the problem for me too. Can we add this modification to the code? Is there any problem with that? SCRATCH THAT! I see you can see that option in the karma conf file... |
It solved the problem for me as well. |
Once our test suite got to a certain size, our build server started consistently failing to complete the tests. Adjusting the timeout settings helped, but didn't resolve the issue—we were still getting failures maybe 30-50% of the time. Upgrading the server from a 4 GB single core to 16 GB quad-core has solved the problem, for now. |
I had the issue with PhantomJS when running on the build server. When tests were running on local computer everything was fine but browser kept disconnecting when running on build server. I dug to the core of the problem. Our application start page had a component which was trying to reach external site and it could do it on local computer but that was forbidden on build server. That caused some significant delay while loading page and in turn that led to no activity timeout. Karma just disconnected client because of that and it took me some time to figure out what was the reason. I think it may be better when browser is pinging karma so it could track browser activity than just timeout. Or may be combination of both approaches would be even better when it times out if it does not receive next ping in certain time interval. |
We are getting this issue more often in some machine even with:
I will try to increase it even more, but there is something wrong here. Any suggestions, ideas? Thanks |
Ran into this problem on our build servers. The root problem was available RAM. PhantomJS is quite memory hungry and was consuming ~75% of the available 2GB RAM. The 1100 tests would take 1m30s to run and then the build would fail when phantomJS failed to disconnect after 60000ms. Increasing the build node VM RAM from 2GB to 4GB resulted in the 1100 tests completing in 45s and the browser disconnecting within 5s. Of course this means we need to profile our code to determine why so much memory is utilized... |
I've noticed that using pre-processors can cause this to increase as well. Since karma launches the browser then processes all the files. If your preprocessors take a long time to run then I'll bet you see a direct correlation. |
I get the same error. ->grunt karma Aborted due to warnings. Here's the repo.. |
Adding the following lines to my karma config solved the problem for me: // If browser does not capture in given timeout [ms], kill it
captureTimeout: 60000,
+ // to avoid DISCONNECTED messages
+ browserDisconnectTimeout : 10000, // default 2000
+ browserDisconnectTolerance : 1, // default 0
+ browserNoActivityTimeout : 60000, //default 10000 Source: codymikol/karma-webpack#8 |
I encountered the disconnect problem this week too. After way too much experimentation with different combinations of versions of Node, Karma, Karma launchers and PhantomJS, I realized it had to be something I did, not the tools. I eventually figured out that my problem was a very poorly written (authored by, of course, me) Jasmine spec that uses Angular's I was doing something like this:
I'm still not 100% sure why, but this caused something to hang indefinitely, which caused Karma to never respond, which eventually led to PhantomJS timing out. Using The point is, if you see too have a problem like what is described here, it's likely to be something going wrong in your test suite and not a bug in Karma or PhantomJS. |
Increasing it should help with Travis not being able to run the integration tests. karma-runner/karma#598
Adds `secrets.tar.enc` which contains an API key, so that CircleCI can run the integration tests. Secret for the tar is configured in the web UI. Increases the timeout to help with potential flakiness. http://stackoverflow.com/a/23492442/101923 karma-runner/karma#598
I solved this problem by updating the browser |
This seems like an usual issue [1][2] which is probably related to the server load. While not fixing the root cause, this contribution uses a commonly employed technique: it doubles how long Karma wait for a message from the browser before disconnecting from it. [1] karma-runner/karma#598 [2] codymikol/karma-webpack#8 Change-Id: Id809a3c6d518edda6835b9b97eb3e53e438a8cb8
Hi,
Karma: 0.8.6
PhantomJS: 1.9
Node: v0.10.2, v0.10.7
I'm seeing random disconnect messages in single run mode. Is this a known problem? I tried monkey patching the socket.io transports to only do xhr and jsonp but it still happens. Any ideas?
The text was updated successfully, but these errors were encountered: