Skip to content

Commit 4610e37

Browse files
committed
refactor: update method names in RedisJobQueueTests for clarity and consistency
1 parent 3fb6b5f commit 4610e37

3 files changed

Lines changed: 15 additions & 9 deletions

File tree

samples/Foundatio.SampleJob/PingQueueJob.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ public PingQueueJob(IQueue<PingRequest> queue, ICacheClient cacheClient, IMessag
2828

2929
protected override Task<ILock?> GetQueueEntryLockAsync(IQueueEntry<PingRequest> queueEntry, CancellationToken cancellationToken = new CancellationToken())
3030
{
31-
return _locker.AcquireAsync(String.Concat("pull:", queueEntry.Value!.Id),
31+
return _locker.TryAcquireAsync(String.Concat("pull:", queueEntry.Value.Id),
3232
TimeSpan.FromMinutes(30),
3333
TimeSpan.FromSeconds(1));
3434
}

tests/Foundatio.Redis.Tests/Foundatio.Redis.Tests.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33
<OutputType>Exe</OutputType>
44
</PropertyGroup>
55
<ItemGroup>
6-
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="18.4.0" />
6+
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="18.5.1" />
77
<PackageReference Include="xunit.v3.mtp-v2" Version="3.2.2" />
88
<PackageReference Include="xunit.runner.visualstudio" Version="3.1.5" />
9-
<PackageReference Include="GitHubActionsTestLogger" Version="3.0.3" PrivateAssets="All" />
9+
<PackageReference Include="GitHubActionsTestLogger" Version="3.0.4" PrivateAssets="All" />
1010

1111
<PackageReference Include="Foundatio.TestHarness" Version="13.0.0" Condition="'$(ReferenceFoundatioSource)' == '' OR '$(ReferenceFoundatioSource)' == 'false'" />
1212
<ProjectReference Include="..\..\..\Foundatio\src\Foundatio.TestHarness\Foundatio.TestHarness.csproj" Condition="'$(ReferenceFoundatioSource)' == 'true'" />

tests/Foundatio.Redis.Tests/Jobs/RedisJobQueueTests.cs

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,15 +32,15 @@ protected override IQueue<SampleQueueWorkItem> GetSampleWorkItemQueue(int retrie
3232
}
3333

3434
[Fact]
35-
public override Task CanRunMultipleQueueJobsAsync()
35+
public override Task ActivityWillFlowThroughQueueJobAsync()
3636
{
37-
return base.CanRunMultipleQueueJobsAsync();
37+
return base.ActivityWillFlowThroughQueueJobAsync();
3838
}
3939

4040
[Fact]
41-
public override Task CanRunQueueJobWithLockFailAsync()
41+
public override Task CanRunMultipleQueueJobsAsync()
4242
{
43-
return base.CanRunQueueJobWithLockFailAsync();
43+
return base.CanRunMultipleQueueJobsAsync();
4444
}
4545

4646
[Fact]
@@ -50,9 +50,15 @@ public override Task CanRunQueueJobAsync()
5050
}
5151

5252
[Fact]
53-
public override Task ActivityWillFlowThroughQueueJobAsync()
53+
public override Task CanRunQueueJobWithLockFailAsync()
5454
{
55-
return base.ActivityWillFlowThroughQueueJobAsync();
55+
return base.CanRunQueueJobWithLockFailAsync();
56+
}
57+
58+
[Fact]
59+
public override Task GetQueueEntryLockAsync_WhenLockThrows_AbandonsQueueEntry()
60+
{
61+
return base.GetQueueEntryLockAsync_WhenLockThrows_AbandonsQueueEntry();
5662
}
5763

5864
public override async ValueTask InitializeAsync()

0 commit comments

Comments
 (0)