Skip to content

Commit 9dc0e2a

Browse files
eabaAaronontheweb
andauthored
Refatcored to async Tests (#5549)
Co-authored-by: Aaron Stannard <[email protected]>
1 parent e5a5bd3 commit 9dc0e2a

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/core/Akka.Tests/Loggers/LoggerSpec.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,12 @@ public LoggerSpec(ITestOutputHelper output) : base(Config, output)
2929
{ }
3030

3131
[Fact]
32-
public void TestOutputLogger_WithBadFormattingMustNotThrow()
32+
public async Task TestOutputLogger_WithBadFormattingMustNotThrow()
3333
{
3434
var events = new List<LogEvent>();
3535

3636
// Need to wait until TestOutputLogger initializes
37-
Thread.Sleep(200);
37+
await Task.Delay(500);
3838
Sys.EventStream.Subscribe(TestActor, typeof(LogEvent));
3939

4040
Sys.Log.Error(new FakeException("BOOM"), Case.t, Case.p);
@@ -68,7 +68,7 @@ public void TestOutputLogger_WithBadFormattingMustNotThrow()
6868
}
6969

7070
[Fact]
71-
public void DefaultLogger_WithBadFormattingMustNotThrow()
71+
public async Task DefaultLogger_WithBadFormattingMustNotThrow()
7272
{
7373
var config = ConfigurationFactory.ParseString("akka.loggers = [\"Akka.Event.DefaultLogger\"]");
7474
var sys2 = ActorSystem.Create("DefaultLoggerTest", config.WithFallback(Sys.Settings.Config));
@@ -88,11 +88,11 @@ public void DefaultLogger_WithBadFormattingMustNotThrow()
8888
sys2.Log.Debug(Case.t, Case.p);
8989
probe.ExpectMsg<Debug>();
9090

91-
sys2.Terminate().Wait();
91+
await sys2.Terminate();
9292
}
9393

9494
[Fact]
95-
public void StandardOutLogger_WithBadFormattingMustNotThrow()
95+
public async Task StandardOutLogger_WithBadFormattingMustNotThrow()
9696
{
9797
var config = ConfigurationFactory.ParseString("akka.loggers = [\"Akka.Event.StandardOutLogger\"]");
9898
var sys2 = ActorSystem.Create("StandardOutLoggerTest", config.WithFallback(Sys.Settings.Config));
@@ -112,7 +112,7 @@ public void StandardOutLogger_WithBadFormattingMustNotThrow()
112112
sys2.Log.Debug(Case.t, Case.p);
113113
probe.ExpectMsg<Debug>();
114114

115-
sys2.Terminate().Wait();
115+
await sys2.Terminate();
116116
}
117117

118118
[Theory]

0 commit comments

Comments
 (0)