Commit 4b50c4f5 authored by Nick Craver's avatar Nick Craver Committed by Nick Craver

Tests: fix Profiling.Simple

parent d27870d4
...@@ -29,7 +29,8 @@ public void Simple() ...@@ -29,7 +29,8 @@ public void Simple()
conn.RegisterProfiler(profiler); conn.RegisterProfiler(profiler);
conn.BeginProfiling(profiler.MyContext); conn.BeginProfiling(profiler.MyContext);
var db = conn.GetDatabase(); var dbId = TestConfig.GetDedicatedDB();
var db = conn.GetDatabase(dbId);
db.StringSet(key, "world"); db.StringSet(key, "world");
var val = db.StringGet(key); var val = db.StringGet(key);
Assert.Equal("world", (string)val); Assert.Equal("world", (string)val);
...@@ -49,17 +50,17 @@ public void Simple() ...@@ -49,17 +50,17 @@ public void Simple()
Assert.True(set.CommandCreated <= get.CommandCreated); Assert.True(set.CommandCreated <= get.CommandCreated);
Assert.True(get.CommandCreated <= eval.CommandCreated); Assert.True(get.CommandCreated <= eval.CommandCreated);
AssertProfiledCommandValues(set, conn); AssertProfiledCommandValues(set, conn, dbId);
AssertProfiledCommandValues(get, conn); AssertProfiledCommandValues(get, conn, dbId);
AssertProfiledCommandValues(eval, conn); AssertProfiledCommandValues(eval, conn, dbId);
} }
} }
private static void AssertProfiledCommandValues(IProfiledCommand command, ConnectionMultiplexer conn) private static void AssertProfiledCommandValues(IProfiledCommand command, ConnectionMultiplexer conn, int dbId)
{ {
Assert.Equal(4, command.Db); Assert.Equal(dbId, command.Db);
Assert.Equal(conn.GetEndPoints()[0], command.EndPoint); Assert.Equal(conn.GetEndPoints()[0], command.EndPoint);
Assert.True(command.CreationToEnqueued > TimeSpan.Zero); Assert.True(command.CreationToEnqueued > TimeSpan.Zero);
Assert.True(command.EnqueuedToSending > TimeSpan.Zero); Assert.True(command.EnqueuedToSending > TimeSpan.Zero);
......
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