diff --git a/src/core/Akka.Tests/Util/IndexSpec.cs b/src/core/Akka.Tests/Util/IndexSpec.cs index 0e9cef3eb8e..0a184bbaeb8 100644 --- a/src/core/Akka.Tests/Util/IndexSpec.cs +++ b/src/core/Akka.Tests/Util/IndexSpec.cs @@ -12,6 +12,7 @@ using Akka.TestKit; using Akka.Util; using Xunit; +using FluentAssertions; namespace Akka.Tests.Util { @@ -115,7 +116,7 @@ public void Index_must_be_cleared() } [Fact] - public void Index_must_be_accessed_in_parallel() + public async Task Index_must_be_accessed_in_parallel() { var index = new Index(); @@ -162,7 +163,7 @@ public void Index_must_be_accessed_in_parallel() var tasks = Enumerable.Repeat(randomTask(), nrOfTasks).Select(Task.Run); - Task.WaitAll(tasks.ToArray(), GetTimeoutOrDefault(null)); + (await Task.WhenAll(tasks.ToArray()).AwaitWithTimeout(GetTimeoutOrDefault(null))).Should().BeTrue(); } } }