Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions src/core/Akka.Tests/Loggers/LoggerSpec.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,12 @@ public LoggerSpec(ITestOutputHelper output) : base(Config, output)
{ }

[Fact]
public void TestOutputLogger_WithBadFormattingMustNotThrow()
public async Task TestOutputLogger_WithBadFormattingMustNotThrow()
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This test is very stable - failed once in 30 days.
Changed to async test

{
var events = new List<LogEvent>();

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

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

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

sys2.Terminate().Wait();
await sys2.Terminate();
}

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

sys2.Terminate().Wait();
await sys2.Terminate();
}

[Theory]
Expand Down