Why do NAnt <nunit2> tasks take 30s to start?

We run our NUnit tests using the <nunit2> Nant task, by iterating over our test assemblies:

<trycatch failonerror="false">
<try>
<nunit2 verbose="true" haltonfailure="false" failonerror="true" >
<formatter type="Plain" />
<test>
<assemblies basedir="${base.dir}">
<include name="${assembly}" />
</assemblies>
<categories>
<exclude name="${nunit.exclude}"/>
</categories>
</test>
</nunit2>
</try>
<catch>
<echo message="=== Failed Nunit test in assembly ${assembly} ==="/>
<property name="nunitFailed" value="true"/>
</catch>
</trycatch>

Each time we hit this code, we see a 25-35 second delay before any tests get run. For example, in the logs we see:

[12:21:14]:    [foreach] trycatch (1m:21s)
[12:21:46]:     [trycatch] Start TeamCity NUnit Test Runner
[12:21:46]:     [trycatch] Running NUnit-2.5.10 tests under .NET Framework v4.0 x86

Thereafter, the tests themselves run quickly (e.g. a similar duration to when running them in Visual Studio).

This happens for every one of the test assemblies in the build.

Does anyone know what might be taking nunit so long to start? Thanks in advance!

Please sign in to leave a comment.