Commit e00fa9e3 authored by Nick Craver's avatar Nick Craver Committed by Nick Craver

Add more logging to BasicOps.TestQuit

parent a44439df
...@@ -286,16 +286,21 @@ public void GetWithExpiryWrongTypeSync() ...@@ -286,16 +286,21 @@ public void GetWithExpiryWrongTypeSync()
[Fact] [Fact]
public void TestQuit() public void TestQuit()
{ {
string Time() => DateTime.UtcNow.ToString("HH:mm:ss.fff");
SetExpectedAmbientFailureCount(1); SetExpectedAmbientFailureCount(1);
using (var muxer = Create(allowAdmin: true)) using (var muxer = Create(allowAdmin: true))
{ {
muxer.ConnectionFailed += (_, __) => Log("{0}: Connection Failed", Time());
muxer.ConnectionRestored += (_, __) => Log("{0}: Connection Restored", Time());
var db = muxer.GetDatabase(); var db = muxer.GetDatabase();
string key = Guid.NewGuid().ToString(); string key = Guid.NewGuid().ToString();
db.KeyDelete(key, CommandFlags.FireAndForget); db.KeyDelete(key, CommandFlags.FireAndForget);
db.StringSet(key, key, flags: CommandFlags.FireAndForget); db.StringSet(key, key, flags: CommandFlags.FireAndForget);
GetServer(muxer).Execute("QUIT", null, CommandFlags.FireAndForget); Log("{0}: Issuing QUIT", Time());
GetServer(muxer).Execute("QUIT", null);
var watch = Stopwatch.StartNew(); var watch = Stopwatch.StartNew();
Assert.Throws<RedisConnectionException>(() => db.Ping()); Assert.Throws<RedisConnectionException>(() => Log("Ping time: " + db.Ping().ToString()));
watch.Stop(); watch.Stop();
Log("Time to notice quit: {0}ms (any order)", watch.ElapsedMilliseconds); Log("Time to notice quit: {0}ms (any order)", watch.ElapsedMilliseconds);
Thread.Sleep(20); Thread.Sleep(20);
......
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