Commit 59a9e18c authored by Marc Gravell's avatar Marc Gravell

make UseSharedConnection available in TesstConfig.json; defaults to true

parent 8611ed9b
...@@ -402,6 +402,7 @@ private void Incr(IDatabase database, RedisKey key, int delta, ref int total) ...@@ -402,6 +402,7 @@ private void Incr(IDatabase database, RedisKey key, int delta, ref int total)
[Fact] [Fact]
public void ShouldUseSharedMuxer() public void ShouldUseSharedMuxer()
{ {
Writer.WriteLine($"Shared: {SharedFixtureAvailable}");
if (SharedFixtureAvailable) if (SharedFixtureAvailable)
{ {
using (var a = Create()) using (var a = Create())
......
...@@ -43,6 +43,7 @@ static TestConfig() ...@@ -43,6 +43,7 @@ static TestConfig()
public class Config public class Config
{ {
public bool UseSharedConnection { get; set; } = true;
public bool RunLongRunning { get; set; } public bool RunLongRunning { get; set; }
public bool LogToConsole { get; set; } public bool LogToConsole { get; set; }
......
...@@ -12,7 +12,7 @@ namespace StackExchange.Redis.Tests ...@@ -12,7 +12,7 @@ namespace StackExchange.Redis.Tests
{ {
public class SharedConnectionFixture : IDisposable public class SharedConnectionFixture : IDisposable
{ {
public bool IsEnabled => true; // set to false to disable globally public bool IsEnabled { get; }
public const string Key = "Shared Muxer"; public const string Key = "Shared Muxer";
private readonly ConnectionMultiplexer _actualConnection; private readonly ConnectionMultiplexer _actualConnection;
...@@ -21,6 +21,7 @@ public class SharedConnectionFixture : IDisposable ...@@ -21,6 +21,7 @@ public class SharedConnectionFixture : IDisposable
public SharedConnectionFixture() public SharedConnectionFixture()
{ {
IsEnabled = TestConfig.Current.UseSharedConnection;
Configuration = TestBase.GetDefaultConfiguration(); Configuration = TestBase.GetDefaultConfiguration();
_actualConnection = TestBase.CreateDefault( _actualConnection = TestBase.CreateDefault(
output: null, output: null,
......
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