From 499b57b2def50400614221db6334f26dd89336d3 Mon Sep 17 00:00:00 2001 From: Vagisha Nidhi Date: Thu, 19 Sep 2019 19:02:22 +0530 Subject: [PATCH] Redirect procdump process output to diag files (#2181) * Redirect procdump output to diag log files --- .../DefaultDataCollectionLauncher.cs | 2 +- .../DotnetDataCollectionLauncher.cs | 2 +- .../ProcessDumpUtility.cs | 20 ++++++++++++--- .../Interfaces/System/IProcessHelper.cs | 3 ++- .../common/System/ProcessHelper.cs | 15 +++++++++-- .../netstandard/System/ProcessHelper.cs | 3 ++- .../uap10.0/System/ProcessHelper.cs | 3 ++- .../Hosting/DefaultTestHostManager.cs | 2 +- .../Hosting/DotnetTestHostManager.cs | 2 +- .../Client/ProxyOperationManagerTests.cs | 7 +++--- .../DotnetDataCollectionLauncherTests.cs | 6 ++--- .../ProcessDumpUtilityTests.cs | 25 ++++++++++--------- .../Hosting/DefaultTestHostManagerTests.cs | 17 +++++++------ .../Hosting/DotnetTestHostManagerTests.cs | 14 ++++++----- 14 files changed, 77 insertions(+), 44 deletions(-) diff --git a/src/Microsoft.TestPlatform.CrossPlatEngine/DataCollection/DefaultDataCollectionLauncher.cs b/src/Microsoft.TestPlatform.CrossPlatEngine/DataCollection/DefaultDataCollectionLauncher.cs index 63459dd58b..da6d357f4e 100644 --- a/src/Microsoft.TestPlatform.CrossPlatEngine/DataCollection/DefaultDataCollectionLauncher.cs +++ b/src/Microsoft.TestPlatform.CrossPlatEngine/DataCollection/DefaultDataCollectionLauncher.cs @@ -69,7 +69,7 @@ public override int LaunchDataCollector(IDictionary environmentV } var argumentsString = string.Join(" ", commandLineArguments); - var dataCollectorProcess = this.processHelper.LaunchProcess(dataCollectorProcessPath, argumentsString, Directory.GetCurrentDirectory(), environmentVariables, this.ErrorReceivedCallback, this.ExitCallBack); + var dataCollectorProcess = this.processHelper.LaunchProcess(dataCollectorProcessPath, argumentsString, Directory.GetCurrentDirectory(), environmentVariables, this.ErrorReceivedCallback, this.ExitCallBack, null) ; this.DataCollectorProcessId = this.processHelper.GetProcessId(dataCollectorProcess); return this.DataCollectorProcessId; } diff --git a/src/Microsoft.TestPlatform.CrossPlatEngine/DataCollection/DotnetDataCollectionLauncher.cs b/src/Microsoft.TestPlatform.CrossPlatEngine/DataCollection/DotnetDataCollectionLauncher.cs index ca85fac935..ca635679c4 100644 --- a/src/Microsoft.TestPlatform.CrossPlatEngine/DataCollection/DotnetDataCollectionLauncher.cs +++ b/src/Microsoft.TestPlatform.CrossPlatEngine/DataCollection/DotnetDataCollectionLauncher.cs @@ -117,7 +117,7 @@ public override int LaunchDataCollector(IDictionary environmentV var cliArgs = string.Join(" ", commandLineArguments); var argumentsString = string.Format("{0} \"{1}\" {2} ", args, dataCollectorAssemblyPath, cliArgs); - var dataCollectorProcess = this.processHelper.LaunchProcess(currentProcessFileName, argumentsString, Directory.GetCurrentDirectory(), environmentVariables, this.ErrorReceivedCallback, this.ExitCallBack); + var dataCollectorProcess = this.processHelper.LaunchProcess(currentProcessFileName, argumentsString, Directory.GetCurrentDirectory(), environmentVariables, this.ErrorReceivedCallback, this.ExitCallBack, null); this.DataCollectorProcessId = this.processHelper.GetProcessId(dataCollectorProcess); return this.DataCollectorProcessId; } diff --git a/src/Microsoft.TestPlatform.Extensions.BlameDataCollector/ProcessDumpUtility.cs b/src/Microsoft.TestPlatform.Extensions.BlameDataCollector/ProcessDumpUtility.cs index 060941215b..b3c3c74c3a 100644 --- a/src/Microsoft.TestPlatform.Extensions.BlameDataCollector/ProcessDumpUtility.cs +++ b/src/Microsoft.TestPlatform.Extensions.BlameDataCollector/ProcessDumpUtility.cs @@ -42,6 +42,16 @@ public ProcessDumpUtility(IProcessHelper processHelper, IFileHelper fileHelper, this.nativeMethodsHelper = nativeMethodsHelper; } + protected Action OutputReceivedCallback => (process, data) => + { + // Log all standard output message of procdump in diag files. + // Otherwise they end up coming on console in pipleine. + if (EqtTrace.IsInfoEnabled) + { + EqtTrace.Info("ProcessDumpUtility.OutputReceivedCallback: Output received from procdump process: " + data); + } + }; + /// public string GetDumpFile() { @@ -101,7 +111,8 @@ public void StartTriggerBasedProcessDump(int processId, string dumpFileGuid, str testResultsDirectory, null, null, - null) as Process; + null, + this.OutputReceivedCallback) as Process; } /// @@ -126,7 +137,8 @@ public void StartHangBasedProcessDump(int processId, string dumpFileGuid, string testResultsDirectory, null, null, - null) as Process; + null, + this.OutputReceivedCallback) as Process; } /// @@ -171,8 +183,8 @@ private string GetProcDumpExecutable(int processId) } else { - filename = this.nativeMethodsHelper.Is64Bit(this.processHelper.GetProcessHandle(processId)) ? - Constants.Procdump64Process : Constants.ProcdumpProcess; + filename = this.nativeMethodsHelper.Is64Bit(this.processHelper.GetProcessHandle(processId)) ? + Constants.Procdump64Process : Constants.ProcdumpProcess; } var procDumpExe = Path.Combine(procdumpPath, filename); diff --git a/src/Microsoft.TestPlatform.PlatformAbstractions/Interfaces/System/IProcessHelper.cs b/src/Microsoft.TestPlatform.PlatformAbstractions/Interfaces/System/IProcessHelper.cs index 3050ea0f1b..d64f5c8132 100644 --- a/src/Microsoft.TestPlatform.PlatformAbstractions/Interfaces/System/IProcessHelper.cs +++ b/src/Microsoft.TestPlatform.PlatformAbstractions/Interfaces/System/IProcessHelper.cs @@ -20,8 +20,9 @@ public interface IProcessHelper /// Environment variables to set while bootstrapping the process. /// Call back for to read error stream data /// Call back for on process exit + /// Call back for on process output /// The process created. - object LaunchProcess(string processPath, string arguments, string workingDirectory, IDictionary environmentVariables, Action errorCallback, Action exitCallBack); + object LaunchProcess(string processPath, string arguments, string workingDirectory, IDictionary environmentVariables, Action errorCallback, Action exitCallBack, Action outputCallback); /// /// Gets the current process file path. diff --git a/src/Microsoft.TestPlatform.PlatformAbstractions/common/System/ProcessHelper.cs b/src/Microsoft.TestPlatform.PlatformAbstractions/common/System/ProcessHelper.cs index 1ca14d0223..f032383af0 100644 --- a/src/Microsoft.TestPlatform.PlatformAbstractions/common/System/ProcessHelper.cs +++ b/src/Microsoft.TestPlatform.PlatformAbstractions/common/System/ProcessHelper.cs @@ -8,7 +8,6 @@ namespace Microsoft.VisualStudio.TestPlatform.PlatformAbstractions using System.Diagnostics; using System.IO; using System.Reflection; - using Microsoft.VisualStudio.TestPlatform.PlatformAbstractions.Interfaces; /// @@ -19,7 +18,7 @@ public partial class ProcessHelper : IProcessHelper private static readonly string ARM = "arm"; /// - public object LaunchProcess(string processPath, string arguments, string workingDirectory, IDictionary envVariables, Action errorCallback, Action exitCallBack) + public object LaunchProcess(string processPath, string arguments, string workingDirectory, IDictionary envVariables, Action errorCallback, Action exitCallBack, Action outputCallBack) { var process = new Process(); try @@ -31,6 +30,7 @@ public object LaunchProcess(string processPath, string arguments, string working process.StartInfo.FileName = processPath; process.StartInfo.Arguments = arguments; process.StartInfo.RedirectStandardError = true; + process.EnableRaisingEvents = true; if (envVariables != null) @@ -41,6 +41,12 @@ public object LaunchProcess(string processPath, string arguments, string working } } + if (outputCallBack != null) + { + process.StartInfo.RedirectStandardOutput = true; + process.OutputDataReceived += (sender, args) => outputCallBack(sender as Process, args.Data); + } + if (errorCallback != null) { process.ErrorDataReceived += (sender, args) => errorCallback(sender as Process, args.Data); @@ -73,6 +79,11 @@ public object LaunchProcess(string processPath, string arguments, string working { process.BeginErrorReadLine(); } + + if (outputCallBack != null) + { + process.BeginOutputReadLine(); + } } catch (Exception) { diff --git a/src/Microsoft.TestPlatform.PlatformAbstractions/netstandard/System/ProcessHelper.cs b/src/Microsoft.TestPlatform.PlatformAbstractions/netstandard/System/ProcessHelper.cs index 7f1142eb3d..35502d01cd 100644 --- a/src/Microsoft.TestPlatform.PlatformAbstractions/netstandard/System/ProcessHelper.cs +++ b/src/Microsoft.TestPlatform.PlatformAbstractions/netstandard/System/ProcessHelper.cs @@ -19,7 +19,8 @@ public object LaunchProcess( string workingDirectory, IDictionary environmentVariables, Action errorCallback, - Action exitCallBack) + Action exitCallBack, + Action ouputCallBack) { throw new NotImplementedException(); } diff --git a/src/Microsoft.TestPlatform.PlatformAbstractions/uap10.0/System/ProcessHelper.cs b/src/Microsoft.TestPlatform.PlatformAbstractions/uap10.0/System/ProcessHelper.cs index 87f14b6c5f..b3696163c1 100644 --- a/src/Microsoft.TestPlatform.PlatformAbstractions/uap10.0/System/ProcessHelper.cs +++ b/src/Microsoft.TestPlatform.PlatformAbstractions/uap10.0/System/ProcessHelper.cs @@ -20,7 +20,8 @@ public object LaunchProcess( string workingDirectory, IDictionary environmentVariables, Action errorCallback, - Action exitCallBack) + Action exitCallBack, + Action outputCallback) { throw new NotImplementedException(); } diff --git a/src/Microsoft.TestPlatform.TestHostProvider/Hosting/DefaultTestHostManager.cs b/src/Microsoft.TestPlatform.TestHostProvider/Hosting/DefaultTestHostManager.cs index d73a6739e1..ee4341f204 100644 --- a/src/Microsoft.TestPlatform.TestHostProvider/Hosting/DefaultTestHostManager.cs +++ b/src/Microsoft.TestPlatform.TestHostProvider/Hosting/DefaultTestHostManager.cs @@ -370,7 +370,7 @@ private bool LaunchHost(TestProcessStartInfo testHostStartInfo, CancellationToke EqtTrace.Verbose("DefaultTestHostManager: Starting process '{0}' with command line '{1}'", testHostStartInfo.FileName, testHostStartInfo.Arguments); cancellationToken.ThrowIfCancellationRequested(); - this.testHostProcess = this.processHelper.LaunchProcess(testHostStartInfo.FileName, testHostStartInfo.Arguments, testHostStartInfo.WorkingDirectory, testHostStartInfo.EnvironmentVariables, this.ErrorReceivedCallback, this.ExitCallBack) as Process; + this.testHostProcess = this.processHelper.LaunchProcess(testHostStartInfo.FileName, testHostStartInfo.Arguments, testHostStartInfo.WorkingDirectory, testHostStartInfo.EnvironmentVariables, this.ErrorReceivedCallback, this.ExitCallBack, null) as Process; } else { diff --git a/src/Microsoft.TestPlatform.TestHostProvider/Hosting/DotnetTestHostManager.cs b/src/Microsoft.TestPlatform.TestHostProvider/Hosting/DotnetTestHostManager.cs index 0492b8eed8..87a80b0519 100644 --- a/src/Microsoft.TestPlatform.TestHostProvider/Hosting/DotnetTestHostManager.cs +++ b/src/Microsoft.TestPlatform.TestHostProvider/Hosting/DotnetTestHostManager.cs @@ -346,7 +346,7 @@ private bool LaunchHost(TestProcessStartInfo testHostStartInfo, CancellationToke EqtTrace.Verbose("DotnetTestHostManager: Starting process '{0}' with command line '{1}'", testHostStartInfo.FileName, testHostStartInfo.Arguments); cancellationToken.ThrowIfCancellationRequested(); - this.testHostProcess = this.processHelper.LaunchProcess(testHostStartInfo.FileName, testHostStartInfo.Arguments, testHostStartInfo.WorkingDirectory, testHostStartInfo.EnvironmentVariables, this.ErrorReceivedCallback, this.ExitCallBack) as Process; + this.testHostProcess = this.processHelper.LaunchProcess(testHostStartInfo.FileName, testHostStartInfo.Arguments, testHostStartInfo.WorkingDirectory, testHostStartInfo.EnvironmentVariables, this.ErrorReceivedCallback, this.ExitCallBack, null) as Process; } else { diff --git a/test/Microsoft.TestPlatform.CrossPlatEngine.UnitTests/Client/ProxyOperationManagerTests.cs b/test/Microsoft.TestPlatform.CrossPlatEngine.UnitTests/Client/ProxyOperationManagerTests.cs index 1f6f8ed63a..145a5b928e 100644 --- a/test/Microsoft.TestPlatform.CrossPlatEngine.UnitTests/Client/ProxyOperationManagerTests.cs +++ b/test/Microsoft.TestPlatform.CrossPlatEngine.UnitTests/Client/ProxyOperationManagerTests.cs @@ -491,9 +491,10 @@ private void SetUpMocksForDotNetTestHost() It.IsAny(), It.IsAny>(), It.IsAny>(), - It.IsAny>())) - .Callback, Action, Action>( - (var1, var2, var3, dictionary, errorCallback, exitCallback) => + It.IsAny>(), + It.IsAny>())) + .Callback, Action, Action, Action>( + (var1, var2, var3, dictionary, errorCallback, exitCallback, outputCallback) => { var process = Process.GetCurrentProcess(); diff --git a/test/Microsoft.TestPlatform.CrossPlatEngine.UnitTests/DataCollection/DotnetDataCollectionLauncherTests.cs b/test/Microsoft.TestPlatform.CrossPlatEngine.UnitTests/DataCollection/DotnetDataCollectionLauncherTests.cs index e6bb3e443c..337e267ff4 100644 --- a/test/Microsoft.TestPlatform.CrossPlatEngine.UnitTests/DataCollection/DotnetDataCollectionLauncherTests.cs +++ b/test/Microsoft.TestPlatform.CrossPlatEngine.UnitTests/DataCollection/DotnetDataCollectionLauncherTests.cs @@ -43,7 +43,7 @@ public void LaunchDataCollectorShouldLaunchDataCollectorProcess() List arguments = new List(); this.dataCollectionLauncher.LaunchDataCollector(null, arguments); - this.mockProcessHelper.Verify(x => x.LaunchProcess(It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny>(), It.IsAny>(), It.IsAny>()), Times.Once()); + this.mockProcessHelper.Verify(x => x.LaunchProcess(It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny>(), It.IsAny>(), It.IsAny>(), It.IsAny>()), Times.Once()); } [TestMethod] @@ -55,7 +55,7 @@ public void LaunchDataCollectorShouldAppendDoubleQuoteForDataCollectorDllPath() List arguments = new List(); this.dataCollectionLauncher.LaunchDataCollector(null, arguments); - this.mockProcessHelper.Verify(x => x.LaunchProcess(It.IsAny(), string.Format("{0} \"{1}\" {2} ", "exec", dataCollectorAssemblyPath, string.Join(" ", arguments)), It.IsAny(), It.IsAny>(), It.IsAny>(), It.IsAny>()), Times.Once()); + this.mockProcessHelper.Verify(x => x.LaunchProcess(It.IsAny(), string.Format("{0} \"{1}\" {2} ", "exec", dataCollectorAssemblyPath, string.Join(" ", arguments)), It.IsAny(), It.IsAny>(), It.IsAny>(), It.IsAny>(), It.IsAny>()), Times.Once()); } [TestMethod] @@ -66,7 +66,7 @@ public void LaunchDataCollectorShouldLaunchDataCollectorProcessWithCurrecntWorki string currentWorkingDirectory = Directory.GetCurrentDirectory(); - this.mockProcessHelper.Verify(x => x.LaunchProcess(It.IsAny(), It.IsAny(), currentWorkingDirectory, It.IsAny>(), It.IsAny>(), It.IsAny>()), Times.Once()); + this.mockProcessHelper.Verify(x => x.LaunchProcess(It.IsAny(), It.IsAny(), currentWorkingDirectory, It.IsAny>(), It.IsAny>(), It.IsAny>(), It.IsAny>()), Times.Once()); } } } diff --git a/test/Microsoft.TestPlatform.Extensions.BlameDataCollector.UnitTests/ProcessDumpUtilityTests.cs b/test/Microsoft.TestPlatform.Extensions.BlameDataCollector.UnitTests/ProcessDumpUtilityTests.cs index 384ad8c514..c05a1316a9 100644 --- a/test/Microsoft.TestPlatform.Extensions.BlameDataCollector.UnitTests/ProcessDumpUtilityTests.cs +++ b/test/Microsoft.TestPlatform.Extensions.BlameDataCollector.UnitTests/ProcessDumpUtilityTests.cs @@ -4,6 +4,7 @@ namespace Microsoft.TestPlatform.Extensions.BlameDataCollector.UnitTests { using System; + using System.Collections.Generic; using System.Diagnostics; using System.IO; @@ -57,7 +58,7 @@ public void GetDumpFileWillThrowExceptionIfNoDumpfile() .Returns(new string[] { }); this.mockProcessHelper.Setup(x => x.GetProcessName(processId)) .Returns(process); - this.mockProcessHelper.Setup(x => x.LaunchProcess(It.IsAny(), It.IsAny(), It.IsAny(), null, null, null)) + this.mockProcessHelper.Setup(x => x.LaunchProcess(It.IsAny(), It.IsAny(), It.IsAny(), null, null, null, It.IsAny>())) .Returns(this.mockProcDumpProcess.Object); var processDumpUtility = new ProcessDumpUtility( @@ -83,7 +84,7 @@ public void GetDumpFileWillReturnEmptyIfProcDumpDidntStart() var processId = 12345; var testResultsDirectory = "D:\\TestResults"; - this.mockProcessHelper.Setup(x => x.LaunchProcess(It.IsAny(), It.IsAny(), It.IsAny(), null, null, null)) + this.mockProcessHelper.Setup(x => x.LaunchProcess(It.IsAny(), It.IsAny(), It.IsAny(), null, null, null, It.IsAny>())) .Throws(new Exception()); this.mockProcessHelper.Setup(x => x.GetProcessName(processId)) .Returns(process); @@ -113,7 +114,7 @@ public void GetDumpFileWillWaitForProcessToExitAndGetDumpFile() .Returns(new string[] { "dump.dmp" }); this.mockProcessHelper.Setup(x => x.GetProcessName(processId)) .Returns(process); - this.mockProcessHelper.Setup(x => x.LaunchProcess(It.IsAny(), It.IsAny(), It.IsAny(), null, null, null)) + this.mockProcessHelper.Setup(x => x.LaunchProcess(It.IsAny(), It.IsAny(), It.IsAny(), null, null, null, It.IsAny>())) .Returns(this.mockProcDumpProcess.Object); var processDumpUtility = new ProcessDumpUtility( @@ -141,7 +142,7 @@ public void StartProcessDumpWillStartProcDumpExeWithCorrectParamsAndGetDumpFileR var args = $"-accepteula -e 1 -g -t -f STACK_OVERFLOW -f ACCESS_VIOLATION {processId} {filename}"; var testResultsDirectory = "D:\\TestResults"; - this.mockProcessHelper.Setup(x => x.LaunchProcess(It.IsAny(), It.IsAny(), It.IsAny(), null, null, null)) + this.mockProcessHelper.Setup(x => x.LaunchProcess(It.IsAny(), It.IsAny(), It.IsAny(), null, null, null, It.IsAny>())) .Returns(this.mockProcDumpProcess.Object); this.mockProcessHelper.Setup(x => x.GetProcessName(processId)) .Returns(process); @@ -157,7 +158,7 @@ public void StartProcessDumpWillStartProcDumpExeWithCorrectParamsAndGetDumpFileR processDumpUtility.StartTriggerBasedProcessDump(processId, guid, testResultsDirectory); - this.mockProcessHelper.Verify(x => x.LaunchProcess(It.IsAny(), args, It.IsAny(), null, null, null), Times.Once); + this.mockProcessHelper.Verify(x => x.LaunchProcess(It.IsAny(), args, It.IsAny(), null, null, null, It.IsAny>()), Times.Once); Assert.AreEqual(Path.Combine(testResultsDirectory, filename), processDumpUtility.GetDumpFile()); } @@ -174,7 +175,7 @@ public void StartProcessDumpWillStartProcDumpExeWithCorrectParamsForFullDump() var args = $"-accepteula -e 1 -g -t -ma -f STACK_OVERFLOW -f ACCESS_VIOLATION {processId} {filename}"; var testResultsDirectory = "D:\\TestResults"; - this.mockProcessHelper.Setup(x => x.LaunchProcess(It.IsAny(), It.IsAny(), It.IsAny(), null, null, null)) + this.mockProcessHelper.Setup(x => x.LaunchProcess(It.IsAny(), It.IsAny(), It.IsAny(), null, null, null, It.IsAny>())) .Returns(this.mockProcDumpProcess.Object); this.mockProcessHelper.Setup(x => x.GetProcessName(processId)) .Returns(process); @@ -189,7 +190,7 @@ public void StartProcessDumpWillStartProcDumpExeWithCorrectParamsForFullDump() processDumpUtility.StartTriggerBasedProcessDump(processId, guid, testResultsDirectory, isFullDump: true); - this.mockProcessHelper.Verify(x => x.LaunchProcess(It.IsAny(), args, It.IsAny(), null, null, null), Times.Once); + this.mockProcessHelper.Verify(x => x.LaunchProcess(It.IsAny(), args, It.IsAny(), null, null, null, It.IsAny>()), Times.Once); Assert.AreEqual(Path.Combine(testResultsDirectory, filename), processDumpUtility.GetDumpFile()); } @@ -206,7 +207,7 @@ public void StartProcessDumpForHangWillStartProcDumpExeWithCorrectParams() var args = $"-accepteula -n 1 -ma {processId} {filename}"; var testResultsDirectory = "D:\\TestResults"; - this.mockProcessHelper.Setup(x => x.LaunchProcess(It.IsAny(), It.IsAny(), It.IsAny(), null, null, null)) + this.mockProcessHelper.Setup(x => x.LaunchProcess(It.IsAny(), It.IsAny(), It.IsAny(), null, null, null, It.IsAny>())) .Returns(this.mockProcDumpProcess.Object); this.mockProcessHelper.Setup(x => x.GetProcessName(processId)) .Returns(process); @@ -221,7 +222,7 @@ public void StartProcessDumpForHangWillStartProcDumpExeWithCorrectParams() processDumpUtility.StartHangBasedProcessDump(processId, guid, testResultsDirectory, isFullDump: true); - this.mockProcessHelper.Verify(x => x.LaunchProcess(It.IsAny(), args, It.IsAny(), null, null, null), Times.Once); + this.mockProcessHelper.Verify(x => x.LaunchProcess(It.IsAny(), args, It.IsAny(), null, null, null, It.IsAny>()), Times.Once); Assert.AreEqual(Path.Combine(testResultsDirectory, filename), processDumpUtility.GetDumpFile()); } @@ -267,7 +268,7 @@ public void StartProcessDumpWillStartExeCorrespondingToTestHostProcessIn32BitOS( processDumpUtility.StartTriggerBasedProcessDump(processId, guid, testResultsDirectory); - this.mockProcessHelper.Verify(x => x.LaunchProcess(Path.Combine("D:\\procdump", "procdump.exe"), It.IsAny(), It.IsAny(), null, null, null)); + this.mockProcessHelper.Verify(x => x.LaunchProcess(Path.Combine("D:\\procdump", "procdump.exe"), It.IsAny(), It.IsAny(), null, null, null, It.IsAny>())); } /// @@ -293,7 +294,7 @@ public void StartProcessDumpWillStartExeCorrespondingTo64BitTestHostProcessIn64B processDumpUtility.StartTriggerBasedProcessDump(processId, "guid", "D:\\"); - this.mockProcessHelper.Verify(x => x.LaunchProcess(Path.Combine("D:\\procdump", "procdump64.exe"), It.IsAny(), It.IsAny(), null, null, null)); + this.mockProcessHelper.Verify(x => x.LaunchProcess(Path.Combine("D:\\procdump", "procdump64.exe"), It.IsAny(), It.IsAny(), null, null, null, It.IsAny>())); } /// @@ -319,7 +320,7 @@ public void StartProcessDumpWillStartExeCorrespondingTo32BitTestHostProcessIn64B processDumpUtility.StartTriggerBasedProcessDump(processId, "guid", "D:\\"); - this.mockProcessHelper.Verify(x => x.LaunchProcess(Path.Combine("D:\\procdump", "procdump.exe"), It.IsAny(), It.IsAny(), null, null, null)); + this.mockProcessHelper.Verify(x => x.LaunchProcess(Path.Combine("D:\\procdump", "procdump.exe"), It.IsAny(), It.IsAny(), null, null, null, It.IsAny>())); } /// diff --git a/test/Microsoft.TestPlatform.TestHostProvider.UnitTests/Hosting/DefaultTestHostManagerTests.cs b/test/Microsoft.TestPlatform.TestHostProvider.UnitTests/Hosting/DefaultTestHostManagerTests.cs index a1456f7010..7d46220a51 100644 --- a/test/Microsoft.TestPlatform.TestHostProvider.UnitTests/Hosting/DefaultTestHostManagerTests.cs +++ b/test/Microsoft.TestPlatform.TestHostProvider.UnitTests/Hosting/DefaultTestHostManagerTests.cs @@ -320,7 +320,8 @@ public void LaunchTestHostShouldReturnTestHostProcessId() It.IsAny(), It.IsAny>(), It.IsAny>(), - It.IsAny>())).Returns(Process.GetCurrentProcess()); + It.IsAny>(), + It.IsAny>())).Returns(Process.GetCurrentProcess()); this.testHostManager.Initialize(this.mockMessageLogger.Object, $" {Architecture.X64} {Framework.DefaultFramework} {false} "); var startInfo = this.testHostManager.GetTestHostProcessStartInfo(Enumerable.Empty(), null, default(TestRunnerConnectionInfo)); @@ -524,9 +525,10 @@ private void ErrorCallBackTestHelper(string errorMessage, int exitCode) It.IsAny(), It.IsAny>(), It.IsAny>(), - It.IsAny>())) - .Callback, Action, Action>( - (var1, var2, var3, dictionary, errorCallback, exitCallback) => + It.IsAny>(), + It.IsAny>())) + .Callback, Action, Action, Action>( + (var1, var2, var3, dictionary, errorCallback, exitCallback, outputCallback) => { var process = Process.GetCurrentProcess(); @@ -556,9 +558,10 @@ private void ExitCallBackTestHelper(int exitCode) It.IsAny(), It.IsAny>(), It.IsAny>(), - It.IsAny>())) - .Callback, Action, Action>( - (var1, var2, var3, dictionary, errorCallback, exitCallback) => + It.IsAny>(), + It.IsAny>())) + .Callback, Action, Action, Action>( + (var1, var2, var3, dictionary, errorCallback, exitCallback, outputCallback) => { var process = Process.GetCurrentProcess(); exitCallback(process); diff --git a/test/Microsoft.TestPlatform.TestHostProvider.UnitTests/Hosting/DotnetTestHostManagerTests.cs b/test/Microsoft.TestPlatform.TestHostProvider.UnitTests/Hosting/DotnetTestHostManagerTests.cs index fc3e857c9d..fed8ecaf98 100644 --- a/test/Microsoft.TestPlatform.TestHostProvider.UnitTests/Hosting/DotnetTestHostManagerTests.cs +++ b/test/Microsoft.TestPlatform.TestHostProvider.UnitTests/Hosting/DotnetTestHostManagerTests.cs @@ -799,9 +799,10 @@ private void ErrorCallBackTestHelper(string errorMessage, int exitCode) It.IsAny(), It.IsAny>(), It.IsAny>(), - It.IsAny>())) - .Callback, Action, Action>( - (var1, var2, var3, dictionary, errorCallback, exitCallback) => + It.IsAny>(), + It.IsAny>())) + .Callback, Action, Action, Action>( + (var1, var2, var3, dictionary, errorCallback, exitCallback, outputCallback) => { var process = Process.GetCurrentProcess(); @@ -822,9 +823,10 @@ private void ExitCallBackTestHelper(int exitCode) It.IsAny(), It.IsAny>(), It.IsAny>(), - It.IsAny>())) - .Callback, Action, Action>( - (var1, var2, var3, dictionary, errorCallback, exitCallback) => + It.IsAny>(), + It.IsAny>())) + .Callback, Action, Action, Action>( + (var1, var2, var3, dictionary, errorCallback, exitCallback, outputCallback) => { var process = Process.GetCurrentProcess(); exitCallback(process);