views:

92

answers:

2

I have a bunch of test projects in my solution. Most of them run instantly and finish instantly. One however takes a long time to complete. The actual tests run fast, but for a long period after all the tests have passed the interface still says "Test Run Completing...". The test run eventually finishes after 10-20 seconds. Has anyone experiences this problem or have any idea what particular aspect of code might cause this?

+1  A: 

Could be a long-running Teardown (in NUnit, TestFixtureTearDown - not sure if it's exactly the same in mstest)? That would run after all tests have finished and could doing some time-intensive clean up. That would explain why all tests have passed by it still appears to be doing something and would be the first thing I would check.

AdaTheDev
That put me on the right track. Seems something was holding onto resources for a extended period of time. Normal destructors were never being called, so I ended up needing to make several classes derive IDisposable and calling the dispose myself.
My Other Me
A: 

Could be a disc I/O problem. The test run will write the results to a number of files. Have you configured these to be on a slow / hard to reach drive?

Chris Arnold
Nope. The other test projects that complete instantly have equal number of tests with comparable volumes of test results are ending up on the same drive.
My Other Me