mirror of
https://github.com/BinaryAlley/Nemera.git
synced 2026-12-03 17:11:10 +00:00
Fixes the flaky callback count assertion in the parallel FileHashService test
This commit is contained in:
1 parent
c44aa80fbd
commit
ebef8f4cae
1 file changed
+2
-1
+2
-1
@@ -43,7 +43,8 @@ public class FileHashServiceTests
|
|||||||
shouldParallelizeReads: true,
|
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;
|
return Task.CompletedTask;
|
||||||
},
|
},
|
||||||
CancellationToken.None);
|
CancellationToken.None);
|
||||||
|
|||||||
Reference in new issue
Block a user