Skip to content

Commit

Permalink
Before the last signal is reported and the benchmark process exits,
Browse files Browse the repository at this point in the history
add an artificial sleep to increase the chance of host process reading all std output.
  • Loading branch information
adamsitnik committed Sep 14, 2022
1 parent 691d11a commit 5394383
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/BenchmarkDotNet/Engines/AnonymousPipesHost.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,13 @@ public void Dispose()

public void SendSignal(HostSignal hostSignal)
{
if (hostSignal == HostSignal.AfterAll)
{
// Before the last signal is reported and the benchmark process exits,
// add an artificial sleep to increase the chance of host process reading all std output.
System.Threading.Thread.Sleep(1);
}

WriteLine(Engine.Signals.ToMessage(hostSignal));

// read the response from Parent process, make the communication blocking
Expand Down

0 comments on commit 5394383

Please sign in to comment.