Skip to content

Commit

Permalink
Tweaked timing of tests to better ensure the tests pass in CI
Browse files Browse the repository at this point in the history
  • Loading branch information
Bronley Plumb committed Oct 2, 2018
1 parent e61cd03 commit 2e6ba87
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions Plumb.Cacher.Tests/CacherTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -165,15 +165,15 @@ public void Reset()
var name = cache.Resolve("name", () =>
{
return "Bob";
}, 20);
}, 50);
Assert.Equal("Bob", name);

//timeout for less than a second.
Thread.Sleep(10);
Thread.Sleep(5);

//reset the cache item, giving it exactly one second to live
cache.Reset("name");
Thread.Sleep(15);
Thread.Sleep(5);

name = cache.Resolve("name", () =>
{
Expand All @@ -182,7 +182,7 @@ public void Reset()
Assert.Equal("Bob", name);

//sleep until after the item should expire. Verify that the item expired
Thread.Sleep(10);
Thread.Sleep(55);
name = cache.Resolve("name", () =>
{
return "Not Bob";
Expand Down

0 comments on commit 2e6ba87

Please sign in to comment.