Commit d5024f5e authored by Marc Gravell's avatar Marc Gravell

transactions: don't log the connect crap; use a StringBuilder to buffer the...

transactions: don't log the connect crap; use a StringBuilder to buffer the tran log to avoid lots of sync blocks
parent d86195d2
using System; using System;
using System.IO; using System.IO;
using System.Runtime.CompilerServices;
using System.Threading; using System.Threading;
using System.Threading.Tasks; using System.Threading.Tasks;
using Xunit; using Xunit;
...@@ -9,6 +10,13 @@ namespace StackExchange.Redis.Tests ...@@ -9,6 +10,13 @@ namespace StackExchange.Redis.Tests
{ {
public class Transactions : TestBase public class Transactions : TestBase
{ {
protected override ConnectionMultiplexer Create(string clientName = null, int? syncTimeout = null, bool? allowAdmin = null, int? keepAlive = null, int? connectTimeout = null, string password = null, string tieBreaker = null, TextWriter log = null, bool fail = true, string[] disabledCommands = null, string[] enabledCommands = null, bool checkConnect = true, string failMessage = null, string channelPrefix = null, Proxy? proxy = null, string configuration = null, [CallerMemberName] string caller = null)
{
return base.Create(clientName, syncTimeout, allowAdmin, keepAlive, connectTimeout, password, tieBreaker,
TextWriter.Null, // <== the one I care about
fail, disabledCommands, enabledCommands, checkConnect, failMessage, channelPrefix, proxy, configuration, caller);
}
public Transactions(ITestOutputHelper output) : base(output) { } public Transactions(ITestOutputHelper output) : base(output) { }
[Fact] [Fact]
...@@ -764,7 +772,7 @@ public async Task BasicTranWithSortedSetContainsCondition(bool demandKeyExists, ...@@ -764,7 +772,7 @@ public async Task BasicTranWithSortedSetContainsCondition(bool demandKeyExists,
[InlineData("", ComparisonType.GreaterThan, 0L, false)] [InlineData("", ComparisonType.GreaterThan, 0L, false)]
public async Task BasicTranWithListLengthCondition(string value, ComparisonType type, long length, bool expectTranResult) public async Task BasicTranWithListLengthCondition(string value, ComparisonType type, long length, bool expectTranResult)
{ {
using (var muxer = Create(log: TextWriter.Null)) using (var muxer = Create())
{ {
RedisKey key = Me(), key2 = Me() + "2"; RedisKey key = Me(), key2 = Me() + "2";
var db = muxer.GetDatabase(); var db = muxer.GetDatabase();
...@@ -903,7 +911,7 @@ public async Task ParallelTransactionsWithConditions() ...@@ -903,7 +911,7 @@ public async Task ParallelTransactionsWithConditions()
try try
{ {
for (int i = 0; i < Muxers; i++) for (int i = 0; i < Muxers; i++)
muxers[i] = Create(log: TextWriter.Null); muxers[i] = Create();
RedisKey hits = Me(), trigger = Me() + "3"; RedisKey hits = Me(), trigger = Me() + "3";
int expectedSuccess = 0; int expectedSuccess = 0;
...@@ -958,8 +966,8 @@ public async Task ParallelTransactionsWithConditions() ...@@ -958,8 +966,8 @@ public async Task ParallelTransactionsWithConditions()
[Fact] [Fact]
public async Task WatchAbort_StringEqual() public async Task WatchAbort_StringEqual()
{ {
using (var vic = Create(log: TextWriter.Null)) using (var vic = Create())
using (var perp = Create(log: TextWriter.Null)) using (var perp = Create())
{ {
var key = Me(); var key = Me();
var db = vic.GetDatabase(); var db = vic.GetDatabase();
...@@ -983,8 +991,8 @@ public async Task WatchAbort_StringEqual() ...@@ -983,8 +991,8 @@ public async Task WatchAbort_StringEqual()
[Fact] [Fact]
public async Task WatchAbort_HashLengthEqual() public async Task WatchAbort_HashLengthEqual()
{ {
using (var vic = Create(log: TextWriter.Null)) using (var vic = Create())
using (var perp = Create(log: TextWriter.Null)) using (var perp = Create())
{ {
var key = Me(); var key = Me();
var db = vic.GetDatabase(); var db = vic.GetDatabase();
......
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