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.IO;
using System.Runtime.CompilerServices;
using System.Threading;
using System.Threading.Tasks;
using Xunit;
......@@ -9,6 +10,13 @@ namespace StackExchange.Redis.Tests
{
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) { }
[Fact]
......@@ -764,7 +772,7 @@ public async Task BasicTranWithSortedSetContainsCondition(bool demandKeyExists,
[InlineData("", ComparisonType.GreaterThan, 0L, false)]
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";
var db = muxer.GetDatabase();
......@@ -903,7 +911,7 @@ public async Task ParallelTransactionsWithConditions()
try
{
for (int i = 0; i < Muxers; i++)
muxers[i] = Create(log: TextWriter.Null);
muxers[i] = Create();
RedisKey hits = Me(), trigger = Me() + "3";
int expectedSuccess = 0;
......@@ -958,8 +966,8 @@ public async Task ParallelTransactionsWithConditions()
[Fact]
public async Task WatchAbort_StringEqual()
{
using (var vic = Create(log: TextWriter.Null))
using (var perp = Create(log: TextWriter.Null))
using (var vic = Create())
using (var perp = Create())
{
var key = Me();
var db = vic.GetDatabase();
......@@ -983,8 +991,8 @@ public async Task WatchAbort_StringEqual()
[Fact]
public async Task WatchAbort_HashLengthEqual()
{
using (var vic = Create(log: TextWriter.Null))
using (var perp = Create(log: TextWriter.Null))
using (var vic = Create())
using (var perp = Create())
{
var key = Me();
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