From ebef8f4caeed3b12938c51fc7098d333d22bc687 Mon Sep 17 00:00:00 2001 From: Binary Alley Date: Sun, 1 Nov 2026 09:35:38 +0200 Subject: [PATCH] Fixes the flaky callback count assertion in the parallel FileHashService test --- .../Core/Security/FileHashServiceTests.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/IntegrationTests/Lumina.Infrastructure.IntegrationTests/Core/Security/FileHashServiceTests.cs b/tests/IntegrationTests/Lumina.Infrastructure.IntegrationTests/Core/Security/FileHashServiceTests.cs index 88795640..73a008d7 100644 --- a/tests/IntegrationTests/Lumina.Infrastructure.IntegrationTests/Core/Security/FileHashServiceTests.cs +++ b/tests/IntegrationTests/Lumina.Infrastructure.IntegrationTests/Core/Security/FileHashServiceTests.cs @@ -43,7 +43,8 @@ public class FileHashServiceTests shouldParallelizeReads: true, () => { - callbackInvocationCount++; + // The callback is invoked concurrently by the parallel reads, so a plain increment could lose a count. + Interlocked.Increment(ref callbackInvocationCount); return Task.CompletedTask; }, CancellationToken.None);