Skip to content

Commit b481fb9

Browse files
Add a margin of error to this test
1 parent ce39368 commit b481fb9

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,9 @@ protected void PerformLeakTest(ConnectionFactory cf)
8484
GC.WaitForPendingFinalizers();
8585
Thread.Sleep(TimeSpan.FromSeconds(10));
8686
Console.WriteLine("{0} handles after the test...", me.HandleCount);
87-
Assert.That(me.HandleCount, Is.LessThanOrEqualTo(n));
87+
// allow for a 20% margin of error, as GC behaviour and native handle
88+
// release is difficult to predict
89+
Assert.That(me.HandleCount, Is.LessThanOrEqualTo(n + 200));
8890
}
8991
}
9092
}

0 commit comments

Comments
 (0)