From 820a580c2289fcfb6e77b21fb38734d44149e6fc Mon Sep 17 00:00:00 2001 From: kkeirstead Date: Wed, 18 Aug 2021 16:45:54 -0700 Subject: [PATCH] Minor tweaks. Noticed the presence of MSBuild_Logs, which I haven't seen before -> not sure what that means and if it's an issue, but made reference to broken pipes. --- dotnet-monitor.sln | 2 +- ...oft.Diagnostics.Monitoring.ExecuteActionApp.csproj} | 0 .../Program.cs | 2 +- .../ExecuteActionTests.cs | 10 ++++------ .../CollectionRules/Actions/ExecuteAction.cs | 1 - ...-20748_0f5b6cf9316c46308d2e3abe6d4df13b.failure.txt | 9 --------- 6 files changed, 6 insertions(+), 18 deletions(-) rename src/Tests/Microsoft.Diagnostics.Monitoring.ExecuteActionApp/{Microsoft.Diagnostics.Monitoring.ExecuteApp.csproj => Microsoft.Diagnostics.Monitoring.ExecuteActionApp.csproj} (100%) delete mode 100644 src/Tools/dotnet-monitor/MSBuild_Logs/MSBuild_pid-20748_0f5b6cf9316c46308d2e3abe6d4df13b.failure.txt diff --git a/dotnet-monitor.sln b/dotnet-monitor.sln index 1c165d5e118..2d67f85e35a 100644 --- a/dotnet-monitor.sln +++ b/dotnet-monitor.sln @@ -38,7 +38,7 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.Diagnostics.Monit EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.Diagnostics.Monitoring.Tool.UnitTests", "src\Tests\Microsoft.Diagnostics.Monitoring.Tool.UnitTests\Microsoft.Diagnostics.Monitoring.Tool.UnitTests.csproj", "{0DBE362D-82F1-4740-AE6A-40C1A82EDCDB}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.Diagnostics.Monitoring.ExecuteApp", "src\Tests\Microsoft.Diagnostics.Monitoring.ExecuteActionApp\Microsoft.Diagnostics.Monitoring.ExecuteApp.csproj", "{A5A0CAAB-C200-44D2-BC93-8445C6E748AD}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.Diagnostics.Monitoring.ExecuteActionApp", "src\Tests\Microsoft.Diagnostics.Monitoring.ExecuteActionApp\Microsoft.Diagnostics.Monitoring.ExecuteActionApp.csproj", "{A5A0CAAB-C200-44D2-BC93-8445C6E748AD}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution diff --git a/src/Tests/Microsoft.Diagnostics.Monitoring.ExecuteActionApp/Microsoft.Diagnostics.Monitoring.ExecuteApp.csproj b/src/Tests/Microsoft.Diagnostics.Monitoring.ExecuteActionApp/Microsoft.Diagnostics.Monitoring.ExecuteActionApp.csproj similarity index 100% rename from src/Tests/Microsoft.Diagnostics.Monitoring.ExecuteActionApp/Microsoft.Diagnostics.Monitoring.ExecuteApp.csproj rename to src/Tests/Microsoft.Diagnostics.Monitoring.ExecuteActionApp/Microsoft.Diagnostics.Monitoring.ExecuteActionApp.csproj diff --git a/src/Tests/Microsoft.Diagnostics.Monitoring.ExecuteActionApp/Program.cs b/src/Tests/Microsoft.Diagnostics.Monitoring.ExecuteActionApp/Program.cs index 03b6525c0cf..e65bd779436 100644 --- a/src/Tests/Microsoft.Diagnostics.Monitoring.ExecuteActionApp/Program.cs +++ b/src/Tests/Microsoft.Diagnostics.Monitoring.ExecuteActionApp/Program.cs @@ -5,7 +5,7 @@ using System.IO; using System.Threading; -namespace Microsoft.Diagnostics.Monitoring.ExecuteApp +namespace Microsoft.Diagnostics.Monitoring.ExecuteActionApp { internal class Program { diff --git a/src/Tests/Microsoft.Diagnostics.Monitoring.Tool.UnitTests/ExecuteActionTests.cs b/src/Tests/Microsoft.Diagnostics.Monitoring.Tool.UnitTests/ExecuteActionTests.cs index 7b50b9433d5..f05fc3bb9f1 100644 --- a/src/Tests/Microsoft.Diagnostics.Monitoring.Tool.UnitTests/ExecuteActionTests.cs +++ b/src/Tests/Microsoft.Diagnostics.Monitoring.Tool.UnitTests/ExecuteActionTests.cs @@ -63,10 +63,10 @@ public async Task ExecuteAction_TokenCancellation() options.Path = DotNetHost.HostExePath; options.Arguments = GenerateArgumentsString(new string[] { "TokenCancellation" }); ; - TaskCanceledException invalidOperationException = await Assert.ThrowsAsync( + TaskCanceledException taskCanceledException = await Assert.ThrowsAsync( () => action.ExecuteAsync(options, null, CreateCancellationToken())); - Assert.Contains(TaskCanceledMessage, invalidOperationException.Message); + Assert.Contains(TaskCanceledMessage, taskCanceledException.Message); } [Fact] @@ -108,9 +108,7 @@ public async Task ExecuteAction_InvalidPath() string uniquePathName = Guid.NewGuid().ToString(); options.Path = uniquePathName; - options.Arguments = Assembly.GetExecutingAssembly().Location.Replace( - Assembly.GetExecutingAssembly().GetName().Name, - "Microsoft.Diagnostics.Monitoring.ExecuteApp"); + options.Arguments = GenerateArgumentsString(Array.Empty()); FileNotFoundException fileNotFoundException = await Assert.ThrowsAsync( () => action.ExecuteAsync(options, null, CreateCancellationToken())); @@ -122,7 +120,7 @@ private static string GenerateArgumentsString(string[] additionalArgs) { return Assembly.GetExecutingAssembly().Location.Replace( Assembly.GetExecutingAssembly().GetName().Name, - "Microsoft.Diagnostics.Monitoring.ExecuteApp") + ' ' + string.Join(' ', additionalArgs); + "Microsoft.Diagnostics.Monitoring.ExecuteActionApp") + ' ' + string.Join(' ', additionalArgs); } private static CancellationToken CreateCancellationToken() diff --git a/src/Tools/dotnet-monitor/CollectionRules/Actions/ExecuteAction.cs b/src/Tools/dotnet-monitor/CollectionRules/Actions/ExecuteAction.cs index c0cdd4fb19d..4464b6c5b9d 100644 --- a/src/Tools/dotnet-monitor/CollectionRules/Actions/ExecuteAction.cs +++ b/src/Tools/dotnet-monitor/CollectionRules/Actions/ExecuteAction.cs @@ -29,7 +29,6 @@ public async Task ExecuteAsync(ExecuteOptions option using Process process = new Process(); process.StartInfo = new ProcessStartInfo(path, arguments); - process.EnableRaisingEvents = true; // Completion source that is signaled when the process exits diff --git a/src/Tools/dotnet-monitor/MSBuild_Logs/MSBuild_pid-20748_0f5b6cf9316c46308d2e3abe6d4df13b.failure.txt b/src/Tools/dotnet-monitor/MSBuild_Logs/MSBuild_pid-20748_0f5b6cf9316c46308d2e3abe6d4df13b.failure.txt deleted file mode 100644 index 107f91c9aa9..00000000000 --- a/src/Tools/dotnet-monitor/MSBuild_Logs/MSBuild_pid-20748_0f5b6cf9316c46308d2e3abe6d4df13b.failure.txt +++ /dev/null @@ -1,9 +0,0 @@ -UNHANDLED EXCEPTIONS FROM PROCESS 20748: -===================== -8/18/2021 2:19:23 PM -System.IO.IOException: Pipe is broken. - at System.IO.Pipes.PipeStream.WriteAsyncCore(ReadOnlyMemory`1 buffer, CancellationToken cancellationToken) in System.IO.Pipes.dll:token 0x60000ec+0x33 - at System.IO.Pipes.PipeStream.WriteAsync(Byte[] buffer, Int32 offset, Int32 count, CancellationToken cancellationToken) in System.IO.Pipes.dll:token 0x60000e1+0x4a - at System.IO.Pipes.PipeStream.Write(Byte[] buffer, Int32 offset, Int32 count) in System.IO.Pipes.dll:token 0x60000df+0x8 - at Microsoft.Build.BackEnd.NodeEndpointOutOfProcBase.RunReadLoop(Stream localReadPipe, Stream localWritePipe, ConcurrentQueue`1 localPacketQueue, AutoResetEvent localPacketAvailable, AutoResetEvent localTerminatePacketPump) in Microsoft.Build.dll:token 0x600107a+0x1b8 -===================