2

Resolved

Building or running with VS creates new temp directories

description

Every time VS runs test discovery with the xUnit.net runner (VS 2013, Windows 8.1 x64; runner version 0.99.0, I get at least one new temp directory that never gets deleted. The structure of the directory is as follows:

PS C:\Users\<Me>\AppData\Local\Temp\069b4c48-acb7-4309-9817-dc2c68ec36e0> gci -rec -name
069b4c48-acb7-4309-9817-dc2c68ec36e0
069b4c48-acb7-4309-9817-dc2c68ec36e0\assembly
069b4c48-acb7-4309-9817-dc2c68ec36e0\assembly\dl3
069b4c48-acb7-4309-9817-dc2c68ec36e0\assembly\tmp
069b4c48-acb7-4309-9817-dc2c68ec36e0\assembly\dl3\362c4b39
069b4c48-acb7-4309-9817-dc2c68ec36e0\assembly\dl3\362c4b39\a383eeae_30e2ce01
069b4c48-acb7-4309-9817-dc2c68ec36e0\assembly\dl3\362c4b39\a383eeae_30e2ce01\xunit.runner.utility.DLL
069b4c48-acb7-4309-9817-dc2c68ec36e0\assembly\dl3\362c4b39\a383eeae_30e2ce01__AssemblyInfo__.ini
PS C:\Users\<Me>\AppData\Local\Temp\069b4c48-acb7-4309-9817-dc2c68ec36e0>

Doing test discovery creates over 30 of these directories, and running a single test creates at least one.

Using the VS runner to do TDD, my temp directory fills up quite fast, to the point that it's becoming impractical. (I think I'll need to switch to TDD.net for this and other reasons.)

comments

DJGrossman wrote Dec 6, 2013 at 5:40 AM

I have observed this behavior on two separate Windows 7 x64 VS2013 installations running 0.99.1, as well.

BradWilson wrote Dec 7, 2013 at 4:14 AM

Yes, this is related to the memory leak issue we're working on.

We use a separate AppDomain for discovering and running unit tests. Several objects implement MarshalByRefObject, which we have just recently discovered has "connection" state. When we're done discovering or running, we need to make sure that we haven't left any objects in the connected state when we try to shut down the AppDomain; otherwise, the cleanup code (silently) fails when we try to shut down the app domain and delete the temporary folder that was used for shadow copying.

BradWilson wrote Dec 7, 2013 at 8:08 PM

BradWilson wrote Jan 18, 2014 at 7:46 PM

For v2: Fixed in change set #9ad2a8c.

davidmatson wrote Jan 20, 2014 at 6:17 PM

Verified; thanks!

knatten wrote Jan 28, 2014 at 7:48 AM

Will this be fixed in the stable release (the 1.x series)? If not, do you recommend using 2.0.0 in production? I currently get a new copy of my private assemblies in AppData each time I run my tests, and they are never deleted.

For anyone else struggling with this, here's how to clean it up from a Cygwin shell:
rm -rf `ls | egrep "^(\w|-){36}$"`