Skip to content

Commit

Permalink
Add more logging and flushes to name_with_pid in hopes of understandi…
Browse files Browse the repository at this point in the history
…ng why it fails in CI
  • Loading branch information
davidwrighton committed Jul 15, 2021
1 parent 87fcf6e commit 0eaa21f
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/tests/tracing/eventpipe/complus_config/name_config_with_pid.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,17 @@ class NameConfigWithPid
{
static int Main(string[] args)
{
if (args.Length == 0)
Console.WriteLine("No Args");
else
Console.WriteLine($"args[0] = `{args[0]}`");

if (args.Length > 0 && args[0] == "waitforinput")
{
Console.Error.WriteLine("WaitingForInput in ErrorStream");
Console.WriteLine("WaitingForInput");
Console.Error.Flush();
Console.Out.Flush();
Console.ReadLine();
return 100;
}
Expand Down Expand Up @@ -50,13 +57,18 @@ static int Main(string[] args)
process.StartInfo.Environment.Add("COMPlus_EventPipeConfig", "Microsoft-Windows-DotNETRuntime:4c14fccbd:4");
process.StartInfo.Environment.Add("COMPlus_EventPipeOutputPath", outputPathPattern);

Console.WriteLine($"Starting process '{process.StartInfo.FileName}' '{process.StartInfo.Arguments}'");
Console.Out.Flush();
process.Start();

process.StandardError.ReadLine();
Console.WriteLine($"After readline'");
Console.Out.Flush();
uint pid = (uint)process.Id;
string expectedPath = outputPathPattern.Replace("{pid}", pid.ToString());

process.StandardInput.WriteLine("input");
process.StandardInput.Flush();
process.WaitForExit();
if (!File.Exists(expectedPath))
{
Expand Down

0 comments on commit 0eaa21f

Please sign in to comment.