camel-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Daniel Kulp <dk...@apache.org>
Subject Re: camel-cxf dynamic ports...
Date Wed, 27 Jul 2011 15:15:48 GMT

I was hoping to start tackling using parallel tests to make this even faster, 
but the junit4.CamelTestSupport and the CamelSpringTestSupport subclass are 
not at all safe to have multiple test subclasses running in parallel.  Thus, a 
lot of work needs to be done down at that layer first.   :-(

Oh well, dropping 5 minutes off is a good start.  :-)

Dan


On Tuesday, July 26, 2011 10:48:21 PM Daniel Kulp wrote:
> I just made a big commit to camel-cxf that gets enough of the tests switched
> over to dynamic ports and unique contexts that I was able to switch from
> forkMode=perTest to once.   This makes a HUGE difference as it drops the
> tests from 5min 50 secs down to a total of 57 seconds on my machine.
> 
> The main thing I did was consolidate all the tests I could to using the same
> set of ports managed by a new CXFTestSupport class (which dynamically sets
> the port numbers).   Each test uses a unique context on that port, usually
> the name of the test class.   So instead of http://localhost:9000/foo, the
> new URL's are things like "http://localhost:" + port + "/CxfFooTest/foo" 
> or similar.   This saves a ton of time of not starting/stopping ports,
> etc... There is one minor downside right now in that many tests don't have
> proper teardowns so the endpoints remain registered (which is  partially
> why I added the unique contexts) holding memory and such, but it's not too
> bad.   If we tried forkMode=once with unique ports instead of contexts, it
> would not only leak the memory, but could have file handle issues and such
> as the ports would remain open.
> 
> In anycase, there are still a bunch of tests that aren't flipped over to the
> dynamic ports yet, but they don't conflict with each other so aren't a
> problem right now.   I'll tackle them as I get to them.
> 
> Enjoy the faster builds!
-- 
Daniel Kulp
dkulp@apache.org
http://dankulp.com/blog
Talend - http://www.talend.com

Mime
View raw message