Today I noticed that my integration tests with nhibernate were runnning very slow on the build server. Very slow meaning 1 hour to run while they run for 6 minutes on my dev machine all 840 of them. Something was different.
I am using Finalbuilder 5.5 on my build machine and that uses the nunit console to do the dirty work for it.
So I tried running it in the nuint gui tool and there too it was slow.
So I clicked a bit on the tabs, one never knows when one might get lucky and low and behold I was lucky. The Log tab of the GUi builder was getting lots of work.
I know my readers (all 3 of you) prefer pictures over words so here is a picture.
Apparently nunit 2.4.6 has a config somewhere that says log4net should use debug level logging. Which slows down nhibernate like never before.
So I copy pasted my regular log4net nhibernate appender and other config things into the app.config of the test project
- <configSections>
- <section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler,log4net" />
- </configSections>
- <!-- This section contains the log4net configuration settings -->
- <log4net debug="false">
- <appender name="rollingFile" type="log4net.Appender.RollingFileAppender,log4net" >
- <param name="File" value="nHibernate.log" />
- <param name="AppendToFile" value="true" />
- <param name="RollingStyle" value="Date" />
- <param name="DatePattern" value="yyyy.MM.dd" />
- <param name="StaticLogFileName" value="true" />
- <param name="maxSizeRollBackups" value="10" />
- <layout type="log4net.Layout.PatternLayout,log4net">
- <param name="ConversionPattern" value="%d [%t] %-5p %c - %m%n" />
- </layout>
- </appender>
- <!-- Setup the root category, add the appenders and set the default priority -->
- <root>
- <level value="Info"/>
- <appender-ref ref="rollingFile"/>
- </root>
- <logger name="NHibernate">
- <level value="Warn" />
- <appender-ref ref="rollingFile"/>
- </logger>
- <logger name="NHibernate.Loader.Loader">
- <level value="Warn" />
- <appender-ref ref="rollingFile"/>
- </logger>
- </log4net>
and added this to the first test, just to check if it was faster.
- log4net.Config.XmlConfigurator.Configure()
And now my integration tests are back to their normal slow self.
I think this problem will not occur in nunit 2.5 and above since they now use a different logger then log4net.




Have you tried NLog (http://www.nlog-project.org/)?
LTD Social Sitings
Note: Watch for social icons on posts by your favorite authors to follow their postings on these and other social sites.