Commit 267ec00d authored by Nick Craver's avatar Nick Craver

Tests: moar logging and tweaks

parent 56fea247
...@@ -606,7 +606,9 @@ public void SimpleProfiling() ...@@ -606,7 +606,9 @@ public void SimpleProfiling()
Assert.Equal("world", val); Assert.Equal("world", val);
var msgs = conn.FinishProfiling(profiler.MyContext); var msgs = conn.FinishProfiling(profiler.MyContext);
Log("Checking GET...");
Assert.Contains(msgs, m => m.Command == "GET"); Assert.Contains(msgs, m => m.Command == "GET");
Log("Checking SET...");
Assert.Contains(msgs, m => m.Command == "SET"); Assert.Contains(msgs, m => m.Command == "SET");
Assert.Equal(2, msgs.Count()); Assert.Equal(2, msgs.Count());
} }
......
...@@ -123,7 +123,8 @@ public async Task BasicStringGetPerf() ...@@ -123,7 +123,8 @@ public async Task BasicStringGetPerf()
Assert.Equal("some value", syncVal); Assert.Equal("some value", syncVal);
Assert.Equal("some value", asyncVal); Assert.Equal("some value", asyncVal);
// let's allow 20% async overhead // let's allow 20% async overhead
Assert.True(asyncTimer.ElapsedMilliseconds <= (syncTimer.ElapsedMilliseconds * 1.2M)); // But with a floor, since the base can often be zero
Assert.True(asyncTimer.ElapsedMilliseconds <= System.Math.Max(syncTimer.ElapsedMilliseconds * 1.2M, 20));
} }
} }
} }
......
...@@ -453,10 +453,10 @@ public void LowAllocationEnumerable() ...@@ -453,10 +453,10 @@ public void LowAllocationEnumerable()
Assert.True(object.ReferenceEquals(i, j)); Assert.True(object.ReferenceEquals(i, j));
} }
Assert.Equal(OuterLoop * 2, res.Count());
Assert.Equal(OuterLoop, res.Count(r => r.Command == "GET")); Assert.Equal(OuterLoop, res.Count(r => r.Command == "GET"));
Assert.Equal(OuterLoop, res.Count(r => r.Command == "SET")); Assert.Equal(OuterLoop, res.Count(r => r.Command == "SET"));
Assert.Equal(OuterLoop * 2, res.Count());
} }
} }
......
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