Commit da0ffb62 authored by Nick Craver's avatar Nick Craver

Socket test for exhaustion

parent 4531bc3d
using System.Diagnostics;
using Xunit.Abstractions;
namespace StackExchange.Redis.Tests
{
public class Sockets : TestBase
{
protected override string GetConfiguration() => TestConfig.Current.MasterServerAndPort;
public Sockets(ITestOutputHelper output) : base (output) { }
[FactLongRunning]
public void CheckForSocketLeaks()
{
const int count = 2000;
for (var i = 0; i < count; i++)
{
using (var conn = Create(clientName: "Test: " + i))
{
// Intentionally just creating and disposing to leak sockets here
// ...so we can figure out what's happening.
}
}
// Force GC before memory dump in debug below...
CollectGarbage();
Debugger.Break();
}
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment