Skip to content

Commit

Permalink
Retry time-based tests (#583)
Browse files Browse the repository at this point in the history
* +tests

* tlfu added

---------
  • Loading branch information
bitfaster authored May 13, 2024
1 parent 315f64e commit 3292910
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 4 deletions.
3 changes: 2 additions & 1 deletion BitFaster.Caching.UnitTests/Lfu/ConcurrentLfuCoreTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
using System.Collections.Generic;
using System.Threading.Tasks;
using BitFaster.Caching.Lfu;
using BitFaster.Caching.UnitTests.Retry;
using FluentAssertions;
using Xunit;

Expand Down Expand Up @@ -85,7 +86,7 @@ public void WhenItemIsUpdatedItIsUpdated()
value.Should().Be(2);
}

[Fact]
[RetryFact]
public void WhenItemDoesNotExistUpdatedAddsItem()
{
lfu.AddOrUpdate(1, 2);
Expand Down
2 changes: 1 addition & 1 deletion BitFaster.Caching.UnitTests/Lfu/ConcurrentTLfuTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ public void WhenKeyTypeMismatchTryGetTimeToExpireReturnsFalse()

// policy can expire after write

[Fact]
[RetryFact]
public void WhenItemIsNotExpiredItIsNotRemoved()
{
lfu.GetOrAdd(1, valueFactory.Create);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public void TimeToLiveIsCtorArg()
this.lru.Policy.ExpireAfterAccess.Value.TimeToLive.Should().Be(timeToLive);
}

[Fact]
[RetryFact]
public void WhenItemIsNotExpiredItIsNotRemoved()
{
lru.GetOrAdd(1, valueFactory.Create);
Expand Down
2 changes: 1 addition & 1 deletion BitFaster.Caching.UnitTests/Lru/ConcurrentTLruTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public void TimeToLiveIsCtorArg()
this.lru.Policy.ExpireAfterWrite.Value.TimeToLive.Should().Be(timeToLive);
}

[Fact]
[RetryFact]
public void WhenItemIsNotExpiredItIsNotRemoved()
{
lru.GetOrAdd(1, valueFactory.Create);
Expand Down

0 comments on commit 3292910

Please sign in to comment.