Skip to content

Commit

Permalink
Block Xunit2 TestKit until unit test logger is ready (#6152)
Browse files Browse the repository at this point in the history
Co-authored-by: Aaron Stannard <aaron@petabridge.com>
  • Loading branch information
Arkatufus and Aaronontheweb authored Oct 6, 2022
1 parent 6655d63 commit d683312
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ public TestOutputLogger(ITestOutputHelper output)
Receive<InitializeLogger>(e =>
{
e.LoggingBus.Subscribe(Self, typeof (LogEvent));
Sender.Tell(new LoggerInitialized());
});
}

Expand Down
6 changes: 4 additions & 2 deletions src/contrib/testkits/Akka.TestKit.Xunit2/TestKit.cs
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,8 @@ protected void InitializeLogger(ActorSystem system)
{
var extSystem = (ExtendedActorSystem)system;
var logger = extSystem.SystemActorOf(Props.Create(() => new TestOutputLogger(Output)), "log-test");
logger.Tell(new InitializeLogger(system.EventStream));
logger.Ask<LoggerInitialized>(new InitializeLogger(system.EventStream), TimeSpan.FromSeconds(3))
.ConfigureAwait(false).GetAwaiter().GetResult();
}
}

Expand All @@ -156,7 +157,8 @@ protected void InitializeLogger(ActorSystem system, string prefix)
var extSystem = (ExtendedActorSystem)system;
var logger = extSystem.SystemActorOf(Props.Create(() => new TestOutputLogger(
string.IsNullOrEmpty(prefix) ? Output : new PrefixedOutput(Output, prefix))), "log-test");
logger.Tell(new InitializeLogger(system.EventStream));
logger.Ask<LoggerInitialized>(new InitializeLogger(system.EventStream), TimeSpan.FromSeconds(3))
.ConfigureAwait(false).GetAwaiter().GetResult();
}
}
public virtual Task InitializeAsync()
Expand Down

0 comments on commit d683312

Please sign in to comment.