Commit 49ca4d8a authored by Nick Craver's avatar Nick Craver

More booksleeve cleanup

parent c619fb11
using System;
using System.Diagnostics;
using System.Threading;
using System.Threading.Tasks;
#if FEATURE_BOOKSLEEVE
using BookSleeve;
#endif
using StackExchange.Redis.KeyspaceIsolation;
using Xunit;
using Xunit.Abstractions;
......
......@@ -12,10 +12,6 @@
using Xunit;
using Xunit.Abstractions;
#if FEATURE_BOOKSLEEVE
using BookSleeve;
#endif
namespace StackExchange.Redis.Tests
{
public abstract class TestBase : IDisposable
......@@ -262,26 +258,6 @@ protected IServer GetAnyMaster(ConnectionMultiplexer muxer)
protected static string Me([CallerMemberName] string caller = null) => caller;
#if FEATURE_BOOKSLEEVE
protected static RedisConnection GetOldStyleConnection(bool open = true, bool allowAdmin = false, bool waitForOpen = false, int syncTimeout = 5000, int ioTimeout = 5000)
{
return GetOldStyleConnection(TestConfig.Current.MasterServer, TestConfig.Current.MasterPort, open, allowAdmin, waitForOpen, syncTimeout, ioTimeout);
}
private static RedisConnection GetOldStyleConnection(string host, int port, bool open = true, bool allowAdmin = false, bool waitForOpen = false, int syncTimeout = 5000, int ioTimeout = 5000)
{
var conn = new RedisConnection(host, port, syncTimeout: syncTimeout, ioTimeout: ioTimeout, allowAdmin: allowAdmin);
conn.Error += (s, args) =>
{
Trace.WriteLine(args.Exception.Message, args.Cause);
};
if (open)
{
var openAsync = conn.Open();
if (waitForOpen) conn.Wait(openAsync);
}
return conn;
}
#endif
protected static TimeSpan RunConcurrent(Action work, int threads, int timeout = 10000, [CallerMemberName] string caller = null)
{
if (work == null) throw new ArgumentNullException(nameof(work));
......
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