The Inquisitive Coder – Davy Brion's Blog

Trying to walk that thin line between intelligence and ignorance

Avoid Using NHibernate With NUnit 2.4.6

Posted by Davy Brion on June 24th, 2009

We just spent about 2 hours trying to find out why our NHibernate tests were about 10x slower on our build server than they were on our local machines. I had noticed lately that the build for one of our projects was taking longer and longer but i hadn’t really timed the difference. This project has about 1200 tests that use NHibernate and they run in about 45-60 seconds on my local machine. It turns out they took around 15 minutes on the buildserver when running them through TeamCity.

I logged into the buildserver and ran the tests manually using nunit’s console runner (with an NUnit-2.4.7 build that i happened to have installed somewhere on the machine) and they only took about 45 seconds. After a lot of guesswork and screwing around, it turned out that we never modified our base build script (why yes, i do believe in build script inheritance) to use a newer version of NUnit. We set up the buildserver about 1 year ago, and at that time, the latest stable NUnit version that TeamCity supported was NUnit 2.4.6. Our base build script was still referring to NUnit 2.4.6, which apparently sets log4net to use debug level logging. Now, NHibernate logs a huge amount of information at the debug level, so this turned out to slow down all of our builds that had NHibernate tests.

We changed the the 2.4.6 version in our script to 2.4.7 and the build time of this particular project decreased from around 50 minutes to about 35 minutes. Yes, that’s still a lot but this is a huge project with a lot of legacy tests and the entire build process is pretty complex. Other projects went from build times from around 7 minutes to about 2 minutes.

That’s a pretty nice improvement for simply changing a “6″ to a “7″ ;)

3 Responses to “Avoid Using NHibernate With NUnit 2.4.6”

  1. chrissie1 Says:

    I’m glad to have helped a fellow Belgianer ;-) .

  2. Reflective Perspective - Chris Alcock » The Morning Brew #376 Says:

    [...] Avoid Using NHibernate With NUnit 2.4.6 – Davy Brion highlights an interesting difference between NUnit 2.4.6 and 2.4.7 and how changing version helped shave a third off the build and test time for NHibernate [...]

  3. Arjan’s World » LINKBLOG for June 25, 2009 Says:

    [...] Avoid Using NHibernate With NUnit 2.4.6 – Davy Brion ‘ We just spent about 2 hours trying to find out why our NHibernate tests were about 10x slower on our build server than they were on our local machines ‘ [...]

Leave a Reply

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>