Preventing Build Hangs and File Locking on Build Servers When Running Unit Tests (revised)

Recently I was tasked with changing our daily and Continuous Integration builds so that they would also execute our unit tests. This seemed like a straightforward task, and indeed it was. Except for one thing: every so often a build would fail because another process was locking the test results directory. When we looked at…