From 8252485ba8641663cc5d827dc048df885e1a3ea1 Mon Sep 17 00:00:00 2001 From: Gregorius Soedharmo Date: Thu, 7 Apr 2022 23:37:03 +0700 Subject: [PATCH] Port Akka.Tests.Actor tests to async/await - ContextWatchWithSpec, ConfigurationSpec --- src/core/Akka.Tests/Actor/ContextWatchWithSpec.cs | 4 ++-- src/core/Akka.Tests/Configuration/ConfigurationSpec.cs | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/core/Akka.Tests/Actor/ContextWatchWithSpec.cs b/src/core/Akka.Tests/Actor/ContextWatchWithSpec.cs index 71a9a72191f..c280e57511e 100644 --- a/src/core/Akka.Tests/Actor/ContextWatchWithSpec.cs +++ b/src/core/Akka.Tests/Actor/ContextWatchWithSpec.cs @@ -30,13 +30,13 @@ public ContextWatchWithSpec(ITestOutputHelper outputHelper) } [Fact(Skip = "This test is used with Performance Profiler to check memory leaks")] - public void Context_WatchWith_Should_not_have_memory_leak() + public async Task Context_WatchWith_Should_not_have_memory_leak() { using (var actorSystem = ActorSystem.Create("repro")) { actorSystem.ActorOf(Props.Create()); - Thread.Sleep(60.Seconds()); + await Task.Delay(60.Seconds()); } } diff --git a/src/core/Akka.Tests/Configuration/ConfigurationSpec.cs b/src/core/Akka.Tests/Configuration/ConfigurationSpec.cs index 18654b6f9f9..f01e2bd8563 100644 --- a/src/core/Akka.Tests/Configuration/ConfigurationSpec.cs +++ b/src/core/Akka.Tests/Configuration/ConfigurationSpec.cs @@ -10,6 +10,7 @@ using Akka.Configuration.Hocon; using System.Linq; using System.Threading; +using System.Threading.Tasks; using Akka.Actor; using Akka.Configuration; using Akka.Dispatch; @@ -86,12 +87,12 @@ public void Deserializes_hocon_configuration_from_net_config_file() // unit test for bug #4330 [Fact] - public void Should_load_config_from_app_config_file() + public async Task Should_load_config_from_app_config_file() { #if !CORECLR var system = ActorSystem.Create(Guid.NewGuid().ToString()); system.Settings.Config.GetBoolean("nonsense.entry").ShouldBeTrue(); - system.Terminate(); + await system.Terminate(); #else // Skip this test for Linux targets Output.WriteLine("This test is skipped.");