Commit 67d23ca1 authored by Nick Craver's avatar Nick Craver

Tests host:port cleanup

There were several mismatches here...this should help avoid future ones.
parent 72b1cbab
...@@ -8,7 +8,7 @@ public class AsyncTests : TestBase ...@@ -8,7 +8,7 @@ public class AsyncTests : TestBase
{ {
public AsyncTests(ITestOutputHelper output) : base (output) { } public AsyncTests(ITestOutputHelper output) : base (output) { }
protected override string GetConfiguration() => TestConfig.Current.MasterServer + ":" + TestConfig.Current.MasterPort; protected override string GetConfiguration() => TestConfig.Current.MasterServerAndPort;
#if DEBUG // IRedisServerDebug and AllowConnect are only available if DEBUG is defined #if DEBUG // IRedisServerDebug and AllowConnect are only available if DEBUG is defined
[Fact] [Fact]
......
...@@ -7,7 +7,7 @@ namespace StackExchange.Redis.Tests ...@@ -7,7 +7,7 @@ namespace StackExchange.Redis.Tests
{ {
public class ConnectionShutdown : TestBase public class ConnectionShutdown : TestBase
{ {
protected override string GetConfiguration() => TestConfig.Current.MasterServer + ":" + TestConfig.Current.MasterPort; protected override string GetConfiguration() => TestConfig.Current.MasterServerAndPort;
public ConnectionShutdown(ITestOutputHelper output) : base (output) { } public ConnectionShutdown(ITestOutputHelper output) : base (output) { }
[Fact(Skip="Unfriendly")] [Fact(Skip="Unfriendly")]
......
...@@ -42,13 +42,16 @@ public class Config ...@@ -42,13 +42,16 @@ public class Config
public string MasterServer { get; set; } = "127.0.0.1"; public string MasterServer { get; set; } = "127.0.0.1";
public int MasterPort { get; set; } = 6379; public int MasterPort { get; set; } = 6379;
public string MasterServerAndPort => MasterServer + ":" + MasterPort.ToString();
public string SlaveServer { get; set; } = "127.0.0.1"; public string SlaveServer { get; set; } = "127.0.0.1";
public int SlavePort { get; set; } = 6380; public int SlavePort { get; set; } = 6380;
public string SlaveServerAndPort => SlaveServer + ":" + SlavePort.ToString();
public string SecureServer { get; set; } = "127.0.0.1"; public string SecureServer { get; set; } = "127.0.0.1";
public int SecurePort { get; set; } = 6381; public int SecurePort { get; set; } = 6381;
public string SecurePassword { get; set; } = "changeme"; public string SecurePassword { get; set; } = "changeme";
public string SecureServerAndPort => SecureServer + ":" + SecurePort.ToString();
public string IPv4Server { get; set; } = "127.0.0.1"; public string IPv4Server { get; set; } = "127.0.0.1";
public int IPv4Port { get; set; } = 6379; public int IPv4Port { get; set; } = 6379;
......
...@@ -28,7 +28,7 @@ public void ConfigurationOptions_UnspecifiedDefaultDb() ...@@ -28,7 +28,7 @@ public void ConfigurationOptions_UnspecifiedDefaultDb()
var log = new StringWriter(); var log = new StringWriter();
try try
{ {
using (var conn = ConnectionMultiplexer.Connect($"{TestConfig.Current.MasterServer}:{TestConfig.Current.MasterPort}", log)) { using (var conn = ConnectionMultiplexer.Connect(TestConfig.Current.MasterServerAndPort, log)) {
var db = conn.GetDatabase(); var db = conn.GetDatabase();
Assert.Equal(0, db.Database); Assert.Equal(0, db.Database);
} }
...@@ -45,7 +45,7 @@ public void ConfigurationOptions_SpecifiedDefaultDb() ...@@ -45,7 +45,7 @@ public void ConfigurationOptions_SpecifiedDefaultDb()
var log = new StringWriter(); var log = new StringWriter();
try try
{ {
using (var conn = ConnectionMultiplexer.Connect($"{TestConfig.Current.MasterServer}:{TestConfig.Current.MasterPort},defaultDatabase=3", log)) { using (var conn = ConnectionMultiplexer.Connect($"{TestConfig.Current.MasterServerAndPort},defaultDatabase=3", log)) {
var db = conn.GetDatabase(); var db = conn.GetDatabase();
Assert.Equal(3, db.Database); Assert.Equal(3, db.Database);
} }
......
...@@ -7,7 +7,7 @@ namespace StackExchange.Redis.Tests.Issues ...@@ -7,7 +7,7 @@ namespace StackExchange.Redis.Tests.Issues
{ {
public class Issue182 : TestBase public class Issue182 : TestBase
{ {
protected override string GetConfiguration() => $"{TestConfig.Current.MasterServer}:{TestConfig.Current.MasterPort},responseTimeout=10000"; protected override string GetConfiguration() => $"{TestConfig.Current.MasterServerAndPort},responseTimeout=10000";
public Issue182(ITestOutputHelper output) : base (output) { } public Issue182(ITestOutputHelper output) : base (output) { }
......
...@@ -29,7 +29,7 @@ public void DefaultValue_IsTrue() ...@@ -29,7 +29,7 @@ public void DefaultValue_IsTrue()
[Fact] [Fact]
public void PreserveAsyncOrder_SetConnectionMultiplexerProperty() public void PreserveAsyncOrder_SetConnectionMultiplexerProperty()
{ {
var multiplexer = ConnectionMultiplexer.Connect(TestConfig.Current.MasterServer + ":" + TestConfig.Current.MasterPort + ",preserveAsyncOrder=false"); var multiplexer = ConnectionMultiplexer.Connect(TestConfig.Current.MasterServerAndPort + ",preserveAsyncOrder=false");
Assert.False(multiplexer.PreserveAsyncOrder); Assert.False(multiplexer.PreserveAsyncOrder);
} }
} }
......
...@@ -7,7 +7,7 @@ namespace StackExchange.Redis.Tests.Issues ...@@ -7,7 +7,7 @@ namespace StackExchange.Redis.Tests.Issues
{ {
public class SO25567566 : TestBase public class SO25567566 : TestBase
{ {
protected override string GetConfiguration() => $"{TestConfig.Current.MasterServer}:{TestConfig.Current.MasterPort}"; protected override string GetConfiguration() => TestConfig.Current.MasterServerAndPort;
public SO25567566(ITestOutputHelper output) : base(output) { } public SO25567566(ITestOutputHelper output) : base(output) { }
[FactLongRunning] [FactLongRunning]
......
...@@ -34,7 +34,7 @@ public void RandomKey() ...@@ -34,7 +34,7 @@ public void RandomKey()
using (var conn = Create(allowAdmin: true)) using (var conn = Create(allowAdmin: true))
{ {
var db = conn.GetDatabase(); var db = conn.GetDatabase();
conn.GetServer(TestConfig.Current.MasterServer, TestConfig.Current.MasterPort).FlushDatabase(); conn.GetServer(TestConfig.Current.MasterServerAndPort).FlushDatabase();
string anyKey = db.KeyRandom(); string anyKey = db.KeyRandom();
Assert.Null(anyKey); Assert.Null(anyKey);
......
...@@ -9,7 +9,7 @@ namespace StackExchange.Redis.Tests ...@@ -9,7 +9,7 @@ namespace StackExchange.Redis.Tests
{ {
public class Locking : TestBase public class Locking : TestBase
{ {
protected override string GetConfiguration() => TestConfig.Current.MasterServer + ":" + TestConfig.Current.MasterPort; protected override string GetConfiguration() => TestConfig.Current.MasterServerAndPort;
public Locking(ITestOutputHelper output) : base (output) { } public Locking(ITestOutputHelper output) : base (output) { }
public enum TestMode public enum TestMode
......
...@@ -12,7 +12,7 @@ namespace StackExchange.Redis.Tests ...@@ -12,7 +12,7 @@ namespace StackExchange.Redis.Tests
public class MultiMaster : TestBase public class MultiMaster : TestBase
{ {
protected override string GetConfiguration() => protected override string GetConfiguration() =>
TestConfig.Current.MasterServer + ":" + TestConfig.Current.SecurePort + "," + TestConfig.Current.MasterServer + ":" + TestConfig.Current.MasterPort + ",password=" + TestConfig.Current.SecurePassword; TestConfig.Current.MasterServerAndPort + "," + TestConfig.Current.SecureServerAndPort + ",password=" + TestConfig.Current.SecurePassword;
public MultiMaster(ITestOutputHelper output) : base (output) { } public MultiMaster(ITestOutputHelper output) : base (output) { }
...@@ -39,8 +39,8 @@ public async Task DeslaveGoesToPrimary() ...@@ -39,8 +39,8 @@ public async Task DeslaveGoesToPrimary()
ConfigurationOptions config = GetMasterSlaveConfig(); ConfigurationOptions config = GetMasterSlaveConfig();
using (var conn = ConnectionMultiplexer.Connect(config)) using (var conn = ConnectionMultiplexer.Connect(config))
{ {
var primary = conn.GetServer(TestConfig.Current.MasterServer, TestConfig.Current.MasterPort); var primary = conn.GetServer(TestConfig.Current.MasterServerAndPort);
var secondary = conn.GetServer(TestConfig.Current.SlaveServer, TestConfig.Current.SlavePort); var secondary = conn.GetServer(TestConfig.Current.SlaveServerAndPort);
primary.Ping(); primary.Ping();
secondary.Ping(); secondary.Ping();
...@@ -58,7 +58,7 @@ public async Task DeslaveGoesToPrimary() ...@@ -58,7 +58,7 @@ public async Task DeslaveGoesToPrimary()
conn.Configure(writer); conn.Configure(writer);
string log = writer.ToString(); string log = writer.ToString();
Assert.True(log.Contains("tie-break is unanimous at " + TestConfig.Current.MasterServer + ":" + TestConfig.Current.MasterPort), "unanimous"); Assert.True(log.Contains("tie-break is unanimous at " + TestConfig.Current.MasterServerAndPort), "unanimous");
} }
// k, so we know everyone loves 6379; is that what we get? // k, so we know everyone loves 6379; is that what we get?
...@@ -89,8 +89,8 @@ public async Task DeslaveGoesToPrimary() ...@@ -89,8 +89,8 @@ public async Task DeslaveGoesToPrimary()
// server topology changes from failures to recognize those changes // server topology changes from failures to recognize those changes
using (var conn2 = ConnectionMultiplexer.Connect(config)) using (var conn2 = ConnectionMultiplexer.Connect(config))
{ {
var primary2 = conn.GetServer(TestConfig.Current.MasterServer, TestConfig.Current.MasterPort); var primary2 = conn.GetServer(TestConfig.Current.MasterServerAndPort);
var secondary2 = conn.GetServer(TestConfig.Current.SlaveServer, TestConfig.Current.SlavePort); var secondary2 = conn.GetServer(TestConfig.Current.SlaveServerAndPort);
Writer.WriteLine($"Check: {primary2.EndPoint}: {primary2.ServerType}, Mode: {(primary2.IsSlave ? "Slave" : "Master")}"); Writer.WriteLine($"Check: {primary2.EndPoint}: {primary2.ServerType}, Mode: {(primary2.IsSlave ? "Slave" : "Master")}");
Writer.WriteLine($"Check: {secondary2.EndPoint}: {secondary2.ServerType}, Mode: {(secondary2.IsSlave ? "Slave" : "Master")}"); Writer.WriteLine($"Check: {secondary2.EndPoint}: {secondary2.ServerType}, Mode: {(secondary2.IsSlave ? "Slave" : "Master")}");
...@@ -143,15 +143,15 @@ public void TestMultiNoTieBreak() ...@@ -143,15 +143,15 @@ public void TestMultiNoTieBreak()
public static IEnumerable<object[]> GetConnections() public static IEnumerable<object[]> GetConnections()
{ {
yield return new object[] { TestConfig.Current.MasterServer + ":" + TestConfig.Current.MasterPort, TestConfig.Current.MasterServer + ":" + TestConfig.Current.MasterPort, TestConfig.Current.MasterServer + ":" + TestConfig.Current.MasterPort }; yield return new object[] { TestConfig.Current.MasterServerAndPort, TestConfig.Current.MasterServerAndPort, TestConfig.Current.MasterServerAndPort };
yield return new object[] { TestConfig.Current.MasterServer + ":" + TestConfig.Current.SecurePort, TestConfig.Current.MasterServer + ":" + TestConfig.Current.SecurePort, TestConfig.Current.MasterServer + ":" + TestConfig.Current.SecurePort }; yield return new object[] { TestConfig.Current.SecureServerAndPort, TestConfig.Current.SecureServerAndPort, TestConfig.Current.SecureServerAndPort };
yield return new object[] { TestConfig.Current.MasterServer + ":" + TestConfig.Current.SecurePort, TestConfig.Current.MasterServer + ":" + TestConfig.Current.MasterPort, null }; yield return new object[] { TestConfig.Current.SecureServerAndPort, TestConfig.Current.MasterServerAndPort, null };
yield return new object[] { TestConfig.Current.MasterServer + ":" + TestConfig.Current.MasterPort, TestConfig.Current.MasterServer + ":" + TestConfig.Current.SecurePort, null }; yield return new object[] { TestConfig.Current.MasterServerAndPort, TestConfig.Current.SecureServerAndPort, null };
yield return new object[] { null, TestConfig.Current.MasterServer + ":" + TestConfig.Current.MasterPort, TestConfig.Current.MasterServer + ":" + TestConfig.Current.MasterPort }; yield return new object[] { null, TestConfig.Current.MasterServerAndPort, TestConfig.Current.MasterServerAndPort };
yield return new object[] { TestConfig.Current.MasterServer + ":" + TestConfig.Current.MasterPort, null, TestConfig.Current.MasterServer + ":" + TestConfig.Current.MasterPort }; yield return new object[] { TestConfig.Current.MasterServerAndPort, null, TestConfig.Current.MasterServerAndPort };
yield return new object[] { null, TestConfig.Current.MasterServer + ":" + TestConfig.Current.SecurePort, TestConfig.Current.MasterServer + ":" + TestConfig.Current.SecurePort }; yield return new object[] { null, TestConfig.Current.SecureServerAndPort, TestConfig.Current.SecureServerAndPort };
yield return new object[] { TestConfig.Current.MasterServer + ":" + TestConfig.Current.SecurePort, null, TestConfig.Current.MasterServer + ":" + TestConfig.Current.SecurePort }; yield return new object[] { TestConfig.Current.SecureServerAndPort, null, TestConfig.Current.SecureServerAndPort };
yield return new object[] { null, null, null }; yield return new object[] { null, null, null };
} }
...@@ -160,11 +160,11 @@ public void TestMultiWithTiebreak(string a, string b, string elected) ...@@ -160,11 +160,11 @@ public void TestMultiWithTiebreak(string a, string b, string elected)
{ {
const string TieBreak = "__tie__"; const string TieBreak = "__tie__";
// set the tie-breakers to the expected state // set the tie-breakers to the expected state
using (var aConn = ConnectionMultiplexer.Connect(TestConfig.Current.MasterServer + ":" + TestConfig.Current.MasterPort)) using (var aConn = ConnectionMultiplexer.Connect(TestConfig.Current.MasterServerAndPort))
{ {
aConn.GetDatabase().StringSet(TieBreak, a); aConn.GetDatabase().StringSet(TieBreak, a);
} }
using (var aConn = ConnectionMultiplexer.Connect(TestConfig.Current.MasterServer + ":" + TestConfig.Current.SecurePort + ",password=" + TestConfig.Current.SecurePassword)) using (var aConn = ConnectionMultiplexer.Connect(TestConfig.Current.SecureServerAndPort + ",password=" + TestConfig.Current.SecurePassword))
{ {
aConn.GetDatabase().StringSet(TieBreak, b); aConn.GetDatabase().StringSet(TieBreak, b);
} }
......
using System.IO; using System.IO;
using System.Threading; using System.Threading;
using System.Threading.Tasks;
using Xunit; using Xunit;
using Xunit.Abstractions; using Xunit.Abstractions;
...@@ -13,7 +14,7 @@ public class PubSubNonParallel : TestBase ...@@ -13,7 +14,7 @@ public class PubSubNonParallel : TestBase
[Theory] [Theory]
[InlineData(false)] [InlineData(false)]
[InlineData(true)] [InlineData(true)]
public void SubscriptionsSurviveMasterSwitch(bool useSharedSocketManager) public async Task SubscriptionsSurviveMasterSwitchAsync(bool useSharedSocketManager)
{ {
using (var a = Create(allowAdmin: true, useSharedSocketManager: useSharedSocketManager)) using (var a = Create(allowAdmin: true, useSharedSocketManager: useSharedSocketManager))
using (var b = Create(allowAdmin: true, useSharedSocketManager: useSharedSocketManager)) using (var b = Create(allowAdmin: true, useSharedSocketManager: useSharedSocketManager))
...@@ -42,10 +43,10 @@ public void SubscriptionsSurviveMasterSwitch(bool useSharedSocketManager) ...@@ -42,10 +43,10 @@ public void SubscriptionsSurviveMasterSwitch(bool useSharedSocketManager)
Interlocked.Increment(ref bCount); Interlocked.Increment(ref bCount);
}); });
Assert.False(a.GetServer(TestConfig.Current.MasterServer, TestConfig.Current.MasterPort).IsSlave, TestConfig.Current.MasterPort + " is master via a"); Assert.False(a.GetServer(TestConfig.Current.MasterServerAndPort).IsSlave, $"{TestConfig.Current.MasterServerAndPort} should be master via a");
Assert.True(a.GetServer(TestConfig.Current.MasterServer, TestConfig.Current.SlavePort).IsSlave, TestConfig.Current.SlavePort + " is slave via a"); Assert.True(a.GetServer(TestConfig.Current.SlaveServerAndPort).IsSlave, $"{TestConfig.Current.SlaveServerAndPort} should be slave via a");
Assert.False(b.GetServer(TestConfig.Current.MasterServer, TestConfig.Current.MasterPort).IsSlave, TestConfig.Current.MasterPort + " is master via b"); Assert.False(b.GetServer(TestConfig.Current.MasterServerAndPort).IsSlave, $"{TestConfig.Current.MasterServerAndPort} should be master via b");
Assert.True(b.GetServer(TestConfig.Current.MasterServer, TestConfig.Current.SlavePort).IsSlave, TestConfig.Current.SlavePort + " is slave via b"); Assert.True(b.GetServer(TestConfig.Current.SlaveServerAndPort).IsSlave, $"{TestConfig.Current.SlaveServerAndPort} should be slave via b");
var epA = subA.SubscribedEndpoint(channel); var epA = subA.SubscribedEndpoint(channel);
var epB = subB.SubscribedEndpoint(channel); var epB = subB.SubscribedEndpoint(channel);
...@@ -68,18 +69,18 @@ public void SubscriptionsSurviveMasterSwitch(bool useSharedSocketManager) ...@@ -68,18 +69,18 @@ public void SubscriptionsSurviveMasterSwitch(bool useSharedSocketManager)
Output.WriteLine("Changing master..."); Output.WriteLine("Changing master...");
using (var sw = new StringWriter()) using (var sw = new StringWriter())
{ {
a.GetServer(TestConfig.Current.MasterServer, TestConfig.Current.SlavePort).MakeMaster(ReplicationChangeOptions.All, sw); a.GetServer(TestConfig.Current.SlaveServerAndPort).MakeMaster(ReplicationChangeOptions.All, sw);
Output.WriteLine(sw.ToString()); Output.WriteLine(sw.ToString());
} }
subA.Ping(); subA.Ping();
subB.Ping(); subB.Ping();
Output.WriteLine("Pausing..."); Output.WriteLine("Pausing...");
Thread.Sleep(2000); await Task.Delay(4000).ForAwait();
Assert.True(a.GetServer(TestConfig.Current.MasterServer, TestConfig.Current.MasterPort).IsSlave, TestConfig.Current.MasterPort + " is slave via a"); Assert.True(a.GetServer(TestConfig.Current.MasterServerAndPort).IsSlave, $"{TestConfig.Current.MasterServerAndPort} should be a slave via a");
Assert.False(a.GetServer(TestConfig.Current.MasterServer, TestConfig.Current.SlavePort).IsSlave, TestConfig.Current.SlavePort + " is master via a"); Assert.False(a.GetServer(TestConfig.Current.SlaveServerAndPort).IsSlave, $"{TestConfig.Current.SlaveServerAndPort} should be a master via a");
Assert.True(b.GetServer(TestConfig.Current.MasterServer, TestConfig.Current.MasterPort).IsSlave, TestConfig.Current.MasterPort + " is slave via b"); Assert.True(b.GetServer(TestConfig.Current.MasterServerAndPort).IsSlave, $"{TestConfig.Current.MasterServerAndPort} should be a slave via b");
Assert.False(b.GetServer(TestConfig.Current.MasterServer, TestConfig.Current.SlavePort).IsSlave, TestConfig.Current.SlavePort + " is master via b"); Assert.False(b.GetServer(TestConfig.Current.SlaveServerAndPort).IsSlave, $"{TestConfig.Current.SlaveServerAndPort} should be a master via b");
Output.WriteLine("Pause complete"); Output.WriteLine("Pause complete");
var counters = a.GetCounters(); var counters = a.GetCounters();
...@@ -88,6 +89,7 @@ public void SubscriptionsSurviveMasterSwitch(bool useSharedSocketManager) ...@@ -88,6 +89,7 @@ public void SubscriptionsSurviveMasterSwitch(bool useSharedSocketManager)
Output.WriteLine("b outstanding: " + counters.TotalOutstanding); Output.WriteLine("b outstanding: " + counters.TotalOutstanding);
subA.Ping(); subA.Ping();
subB.Ping(); subB.Ping();
await Task.Delay(2000).ForAwait();
epA = subA.SubscribedEndpoint(channel); epA = subA.SubscribedEndpoint(channel);
epB = subB.SubscribedEndpoint(channel); epB = subB.SubscribedEndpoint(channel);
Output.WriteLine("a: " + EndPointCollection.ToString(epA)); Output.WriteLine("a: " + EndPointCollection.ToString(epA));
...@@ -108,7 +110,7 @@ public void SubscriptionsSurviveMasterSwitch(bool useSharedSocketManager) ...@@ -108,7 +110,7 @@ public void SubscriptionsSurviveMasterSwitch(bool useSharedSocketManager)
Output.WriteLine("Restoring configuration..."); Output.WriteLine("Restoring configuration...");
try try
{ {
a.GetServer(TestConfig.Current.MasterServer, TestConfig.Current.MasterPort).MakeMaster(ReplicationChangeOptions.All); a.GetServer(TestConfig.Current.MasterServerAndPort).MakeMaster(ReplicationChangeOptions.All);
} }
catch catch
{ } { }
......
...@@ -44,7 +44,7 @@ public void CheckLoads(bool async) ...@@ -44,7 +44,7 @@ public void CheckLoads(bool async)
Skip.IfMissingFeature(conn0, nameof(RedisFeatures.Scripting), f => f.Scripting); Skip.IfMissingFeature(conn0, nameof(RedisFeatures.Scripting), f => f.Scripting);
// note that these are on different connections (so we wouldn't expect // note that these are on different connections (so we wouldn't expect
// the flush to drop the local cache - assume it is a surprise!) // the flush to drop the local cache - assume it is a surprise!)
var server = conn0.GetServer(TestConfig.Current.MasterServer, TestConfig.Current.MasterPort); var server = conn0.GetServer(TestConfig.Current.MasterServerAndPort);
var db = conn1.GetDatabase(); var db = conn1.GetDatabase();
const string script = "return 1;"; const string script = "return 1;";
...@@ -102,7 +102,7 @@ public void CompareScriptToDirect() ...@@ -102,7 +102,7 @@ public void CompareScriptToDirect()
using (var conn = Create(allowAdmin: true)) using (var conn = Create(allowAdmin: true))
{ {
Skip.IfMissingFeature(conn, nameof(RedisFeatures.Scripting), f => f.Scripting); Skip.IfMissingFeature(conn, nameof(RedisFeatures.Scripting), f => f.Scripting);
var server = conn.GetServer(TestConfig.Current.MasterServer, TestConfig.Current.MasterPort); var server = conn.GetServer(TestConfig.Current.MasterServerAndPort);
server.FlushAllDatabases(); server.FlushAllDatabases();
server.ScriptFlush(); server.ScriptFlush();
...@@ -156,7 +156,7 @@ public void TestCallByHash() ...@@ -156,7 +156,7 @@ public void TestCallByHash()
using (var conn = Create(allowAdmin: true)) using (var conn = Create(allowAdmin: true))
{ {
Skip.IfMissingFeature(conn, nameof(RedisFeatures.Scripting), f => f.Scripting); Skip.IfMissingFeature(conn, nameof(RedisFeatures.Scripting), f => f.Scripting);
var server = conn.GetServer(TestConfig.Current.MasterServer, TestConfig.Current.MasterPort); var server = conn.GetServer(TestConfig.Current.MasterServerAndPort);
server.FlushAllDatabases(); server.FlushAllDatabases();
server.ScriptFlush(); server.ScriptFlush();
...@@ -184,7 +184,7 @@ public void SimpleLuaScript() ...@@ -184,7 +184,7 @@ public void SimpleLuaScript()
using (var conn = Create(allowAdmin: true)) using (var conn = Create(allowAdmin: true))
{ {
Skip.IfMissingFeature(conn, nameof(RedisFeatures.Scripting), f => f.Scripting); Skip.IfMissingFeature(conn, nameof(RedisFeatures.Scripting), f => f.Scripting);
var server = conn.GetServer(TestConfig.Current.MasterServer, TestConfig.Current.MasterPort); var server = conn.GetServer(TestConfig.Current.MasterServerAndPort);
server.FlushAllDatabases(); server.FlushAllDatabases();
server.ScriptFlush(); server.ScriptFlush();
...@@ -232,7 +232,7 @@ public void LuaScriptWithKeys() ...@@ -232,7 +232,7 @@ public void LuaScriptWithKeys()
using (var conn = Create(allowAdmin: true)) using (var conn = Create(allowAdmin: true))
{ {
Skip.IfMissingFeature(conn, nameof(RedisFeatures.Scripting), f => f.Scripting); Skip.IfMissingFeature(conn, nameof(RedisFeatures.Scripting), f => f.Scripting);
var server = conn.GetServer(TestConfig.Current.MasterServer, TestConfig.Current.MasterPort); var server = conn.GetServer(TestConfig.Current.MasterServerAndPort);
server.FlushAllDatabases(); server.FlushAllDatabases();
server.ScriptFlush(); server.ScriptFlush();
...@@ -261,7 +261,7 @@ public void NoInlineReplacement() ...@@ -261,7 +261,7 @@ public void NoInlineReplacement()
using (var conn = Create(allowAdmin: true)) using (var conn = Create(allowAdmin: true))
{ {
Skip.IfMissingFeature(conn, nameof(RedisFeatures.Scripting), f => f.Scripting); Skip.IfMissingFeature(conn, nameof(RedisFeatures.Scripting), f => f.Scripting);
var server = conn.GetServer(TestConfig.Current.MasterServer, TestConfig.Current.MasterPort); var server = conn.GetServer(TestConfig.Current.MasterServerAndPort);
server.FlushAllDatabases(); server.FlushAllDatabases();
server.ScriptFlush(); server.ScriptFlush();
...@@ -296,7 +296,7 @@ public void SimpleLoadedLuaScript() ...@@ -296,7 +296,7 @@ public void SimpleLoadedLuaScript()
using (var conn = Create(allowAdmin: true)) using (var conn = Create(allowAdmin: true))
{ {
Skip.IfMissingFeature(conn, nameof(RedisFeatures.Scripting), f => f.Scripting); Skip.IfMissingFeature(conn, nameof(RedisFeatures.Scripting), f => f.Scripting);
var server = conn.GetServer(TestConfig.Current.MasterServer, TestConfig.Current.MasterPort); var server = conn.GetServer(TestConfig.Current.MasterServerAndPort);
server.FlushAllDatabases(); server.FlushAllDatabases();
server.ScriptFlush(); server.ScriptFlush();
...@@ -345,7 +345,7 @@ public void LoadedLuaScriptWithKeys() ...@@ -345,7 +345,7 @@ public void LoadedLuaScriptWithKeys()
using (var conn = Create(allowAdmin: true)) using (var conn = Create(allowAdmin: true))
{ {
Skip.IfMissingFeature(conn, nameof(RedisFeatures.Scripting), f => f.Scripting); Skip.IfMissingFeature(conn, nameof(RedisFeatures.Scripting), f => f.Scripting);
var server = conn.GetServer(TestConfig.Current.MasterServer, TestConfig.Current.MasterPort); var server = conn.GetServer(TestConfig.Current.MasterServerAndPort);
server.FlushAllDatabases(); server.FlushAllDatabases();
server.ScriptFlush(); server.ScriptFlush();
......
...@@ -10,7 +10,7 @@ namespace StackExchange.Redis.Tests ...@@ -10,7 +10,7 @@ namespace StackExchange.Redis.Tests
public class Secure : TestBase public class Secure : TestBase
{ {
protected override string GetConfiguration() => protected override string GetConfiguration() =>
TestConfig.Current.MasterServer + ":" + TestConfig.Current.SecurePort + ",password=" + TestConfig.Current.SecurePassword + ",name=MyClient"; TestConfig.Current.SecureServerAndPort + ",password=" + TestConfig.Current.SecurePassword + ",name=MyClient";
public Secure(ITestOutputHelper output) : base (output) { } public Secure(ITestOutputHelper output) : base (output) { }
......
...@@ -18,7 +18,7 @@ public abstract class TestBase : IDisposable ...@@ -18,7 +18,7 @@ public abstract class TestBase : IDisposable
{ {
protected ITestOutputHelper Output { get; } protected ITestOutputHelper Output { get; }
protected TextWriterOutputHelper Writer { get; } protected TextWriterOutputHelper Writer { get; }
protected virtual string GetConfiguration() => TestConfig.Current.MasterServer + ":" + TestConfig.Current.MasterPort + "," + TestConfig.Current.SlaveServer + ":" + TestConfig.Current.SlavePort; protected virtual string GetConfiguration() => TestConfig.Current.MasterServerAndPort + "," + TestConfig.Current.SlaveServerAndPort;
protected TestBase(ITestOutputHelper output) protected TestBase(ITestOutputHelper output)
{ {
......
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