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″
June 24th, 2009 at 9:57 pm
I’m glad to have helped a fellow Belgianer
.
June 25th, 2009 at 9:30 am
[...] 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 [...]
June 25th, 2009 at 10:09 pm
[...] 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 ‘ [...]