Commit 6dd621b5 authored by Marc Gravell's avatar Marc Gravell

add tessts for #943 (also, unrelated, move libver to later in the exception)

parent 1305424b
...@@ -200,7 +200,7 @@ void add(string lk, string sk, string v) ...@@ -200,7 +200,7 @@ void add(string lk, string sk, string v)
sb.Append(", ").Append(sk).Append(": ").Append(v); sb.Append(", ").Append(sk).Append(": ").Append(v);
} }
} }
add("Version", "v", GetLibVersion());
if (server != null) if (server != null)
{ {
server.GetOutstandingCount(message.Command, out int inst, out int qs, out int @in); server.GetOutstandingCount(message.Command, out int inst, out int qs, out int @in);
...@@ -235,6 +235,8 @@ void add(string lk, string sk, string v) ...@@ -235,6 +235,8 @@ void add(string lk, string sk, string v)
add("Local-CPU", "Local-CPU", PerfCounterHelper.GetSystemCpuPercent()); add("Local-CPU", "Local-CPU", PerfCounterHelper.GetSystemCpuPercent());
} }
add("Version", "v", GetLibVersion());
sb.Append(" (Please take a look at this article for some common client-side issues that can cause timeouts: "); sb.Append(" (Please take a look at this article for some common client-side issues that can cause timeouts: ");
sb.Append(timeoutHelpLink); sb.Append(timeoutHelpLink);
sb.Append(")"); sb.Append(")");
......
...@@ -333,7 +333,6 @@ void add(string lk, string sk, string v) ...@@ -333,7 +333,6 @@ void add(string lk, string sk, string v)
data.Add(Tuple.Create(lk, v)); data.Add(Tuple.Create(lk, v));
exMessage.Append(", ").Append(sk).Append(": ").Append(v); exMessage.Append(", ").Append(sk).Append(": ").Append(v);
} }
add("Version", "v", ExceptionFactory.GetLibVersion());
if (IncludeDetailInExceptions) if (IncludeDetailInExceptions)
{ {
...@@ -370,6 +369,8 @@ void add(string lk, string sk, string v) ...@@ -370,6 +369,8 @@ void add(string lk, string sk, string v)
} }
} }
add("Version", "v", ExceptionFactory.GetLibVersion());
outerException = innerException == null outerException = innerException == null
? new RedisConnectionException(failureType, exMessage.ToString()) ? new RedisConnectionException(failureType, exMessage.ToString())
: new RedisConnectionException(failureType, exMessage.ToString(), innerException); : new RedisConnectionException(failureType, exMessage.ToString(), innerException);
......
...@@ -950,5 +950,37 @@ public async Task WatchAbort_HashLengthEqual() ...@@ -950,5 +950,37 @@ public async Task WatchAbort_HashLengthEqual()
} }
#endif #endif
[Fact]
public async Task ExecCompletes_Issue943()
{
int hashHit = 0, hashMiss = 0, expireHit = 0, expireMiss = 0;
using (var conn = Create())
{
var db = conn.GetDatabase();
for (int i = 0; i < 40000; i++)
{
RedisKey key = Me();
await db.KeyDeleteAsync(key);
HashEntry[] hashEntries = new HashEntry[]
{
new HashEntry("blah", DateTime.UtcNow.ToString("R"))
};
ITransaction transaction = db.CreateTransaction();
ConditionResult keyNotExists = transaction.AddCondition(Condition.KeyNotExists(key));
Task hashSetTask = transaction.HashSetAsync(key, hashEntries);
Task<bool> expireTask = transaction.KeyExpireAsync(key, TimeSpan.FromSeconds(30));
bool committed = await transaction.ExecuteAsync();
if (committed)
{
if (hashSetTask.IsCompleted) hashHit++; else hashMiss++;
if (expireTask.IsCompleted) expireHit++; else expireMiss++;
await hashSetTask;
await expireTask;
}
}
}
Writer.WriteLine($"hash hit: {hashHit}, miss: {hashMiss}; expire hit: {expireHit}, miss: {expireMiss}");
}
} }
} }
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