Skip to content

Commit 4f16ca4

Browse files
Force GC in this test
We use Timers for heartbeats (again) and it seems that Timer#Dispose does not release its underlying native timer (handle), that only happens after the timer is collected. Fixes #102.
1 parent dfa3ea4 commit 4f16ca4

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

projects/client/Unit/src/unit/TestConnectionChurnHandleLeak.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,8 @@ protected void PerformLeakTest(ConnectionFactory cf)
7979
var conn = cf.CreateConnection();
8080
conn.Close();
8181
}
82+
GC.Collect();
83+
GC.WaitForPendingFinalizers();
8284
Thread.Sleep(TimeSpan.FromSeconds(10));
8385
me = Process.GetCurrentProcess();
8486
Console.WriteLine("{0} handles after the test...", me.HandleCount);

0 commit comments

Comments
 (0)