diff --git a/.config/dotnet-tools.json b/.config/dotnet-tools.json index aa081c59..b9c6ae23 100644 --- a/.config/dotnet-tools.json +++ b/.config/dotnet-tools.json @@ -3,21 +3,21 @@ "isRoot": true, "tools": { "dotnet-stryker": { - "version": "5.0.0", + "version": "5.1.0", "commands": [ "dotnet-stryker" ], "rollForward": false }, "jetbrains.resharper.globaltools": { - "version": "2026.2.4.1", + "version": "2026.3.0", "commands": [ "jb" ], "rollForward": false }, "dotnet-ef": { - "version": "10.0.14", + "version": "11.0.0", "commands": [ "dotnet-ef" ], diff --git a/Directory.Packages.props b/Directory.Packages.props index d8177b5d..8c6b77ad 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -5,13 +5,13 @@ - - - - - - - + + + + + + + @@ -22,8 +22,8 @@ - - + + @@ -32,7 +32,7 @@ - + @@ -43,10 +43,10 @@ - + - + diff --git a/src/RustPlusBot.Features.Connections/Listening/TeamStateTracker.cs b/src/RustPlusBot.Features.Connections/Listening/TeamStateTracker.cs index 0907ba32..61c11f88 100644 --- a/src/RustPlusBot.Features.Connections/Listening/TeamStateTracker.cs +++ b/src/RustPlusBot.Features.Connections/Listening/TeamStateTracker.cs @@ -14,7 +14,7 @@ internal sealed record AfkPollContext(DateTimeOffset Clock, TimeSpan Threshold, internal sealed class TeamStateTracker { private readonly HashSet _afk = []; - private readonly object _gate = new(); + private readonly Lock _gate = new(); private readonly Dictionary _stillSince = []; private Dictionary? _baseline; diff --git a/tests/RustPlusBot.Features.Vending.Tests/Hosting/VendingHostedServiceTests.cs b/tests/RustPlusBot.Features.Vending.Tests/Hosting/VendingHostedServiceTests.cs index 5b09d616..1deb8fad 100644 --- a/tests/RustPlusBot.Features.Vending.Tests/Hosting/VendingHostedServiceTests.cs +++ b/tests/RustPlusBot.Features.Vending.Tests/Hosting/VendingHostedServiceTests.cs @@ -161,7 +161,9 @@ public async Task StopAsync_JoinsTheLoopsRatherThanReturningMidHandler() // Cancelling alone cannot end a loop that is mid-handler, so a StopAsync that joins its loop // tasks can never complete here however long we wait — which is what makes waiting sound rather // than a timing assumption. One that did not join would return as soon as the cancel landed. - await Task.WhenAny(stop, Task.Delay(TimeSpan.FromSeconds(2))); + using var window = new CancellationTokenSource(); + await Task.WhenAny(stop, Task.Delay(TimeSpan.FromSeconds(2), window.Token)); + await window.CancelAsync(); // Don't leave the timer running if StopAsync won the race. Assert.False(stop.IsCompleted, "StopAsync returned while a handler was still in flight"); release.SetResult();