nunit/nunit-vs-adapter — pull request #36 by sandshadow (2014-07-01 00:23:51+00:00)
Title: Fix for issue No 24

Fix for issue No 24
The root issue is that NUnitEventListener is a MarshalByRefObject. This means it has a default lifetime lease of 5 minutes, with an extension of 2 minutes every time it receives a callback.
http://msdn.microsoft.com/en-us/magazine/cc300474.aspx#edupdate
Changes:
1. Give NUnitEventListener an infinite lifetime lease
2. Implement IDisposable, and call RemotingServices.Disconnect to prevent memory leaks

I have verified under WinDBG/SOS that when running tests from multiple assemblies, there is only 1 NUnitEventListener on the heap with parents. Without calling RemotingServices.Disconnect, there is an NUnitEventListener for each test assembly. (This is also the case with the current code, until the lifetime lease expires).

The IssueNo24Tests included in the pull request can be excluded from runs with -Trait:"LongRunning". Or I could exclude them from the pull request once the fix has been verified, and just rely on the Listener_LeaseLifetimeWillNotExpire test for coverage.

This is my first GitHub pull request/contribution, so if I have missed something in the workflow, please let me know.