-
Notifications
You must be signed in to change notification settings - Fork 9
Tests take too long to run #17
Comments
Hmm, I dont see the same delays you are getting - can you advise the OS and number of interfaces pls? I'm on kubuntu 15.04, one wifi interface. I just noticed the pull request for released version of jmdns - I'm not using it yet, maybe related? |
I attached a log from running a single test using HEAD (i.e. without the jmdns patch). Run time was 01:35, most of it spent running the test. There's a 69s pause at 20:40:10,239 after
With the new version I was seeing messages about probes on all interfaces but that test does not seem to emit that. I'm rerunning all to see. Nope, no output and completed in 17:55 so a bit quicker. I'll continue to dig in |
Hmm, you have a lot more interfaces, I have eth0, lo, virbr0, wlan0. Its happening in RouteManager.configure0(), at:
So the 69 sec is in the JmmDNS library. Wonder if that can be improved....its a significant part of the boot. |
Found this at http://sourceforge.net/p/jmdns/bugs/82/ "Starting an mDNS incur a penalty of at least 6 seconds so if you create JmDNS when the user ask for the registration there will be 9 to 10 seconds before the service is visible. This has been discussed before and cannot be compressed. The way MacOSX and IOS run around that problem is by having a daemon running in the background on a permanent basis. That way you only need to register the service which take 3 to 4 seconds." |
This is my dev machine which has Docker and other things running. The 6 seconds corresponds with what I was seeing in the logs for the probe timeouts on each interface. If the 6 sec is part of the protocol (admittedly I've not read the spec) there's not much we can do. I don't see this as a problem for normal use as the server would not be restarted often. We may be able to speed things up by starting jmdns on a background thread, IOW start all protocol handlers in parallel, but for now that seems like over-complicating things. I'll take a look at moving tests over to the |
Actually what about setting a system param and wrapping the start in an |
Maybe SignalKCamelTestSupport needs another method |
Ive just commited a fix for this into master - it just runs the mdns init in a background thread. Seems to work for me, but will possibly cause problems with 10 interfaces (6 secs x 10 = 60sec) which may be longer than the test, hence shutdown may not complete nicely. Let me know. |
Added a setDaemon(true) so the thread will die when the JVM exits, hence it should now stop initialising if the test finishes earlier than the init. |
Many of the unit tests start a server which is a process that can take many seconds - about 80 on my machine, for each test, due to the number of interfaces being probed by jMDNS. This makes development quite inefficient as it takes around an hour to run the test suite.
I propose we move most of those to integration tests that will be run during the "verify" phase and add new unit tests that do not require starting an entire server.
The text was updated successfully, but these errors were encountered: