diff --git a/eng/pipelines/extra-platforms/runtime-extra-platforms-wasm.yml b/eng/pipelines/extra-platforms/runtime-extra-platforms-wasm.yml index 056d070705a013..ea18dd02459c90 100644 --- a/eng/pipelines/extra-platforms/runtime-extra-platforms-wasm.yml +++ b/eng/pipelines/extra-platforms/runtime-extra-platforms-wasm.yml @@ -185,7 +185,7 @@ jobs: shouldContinueOnError: ${{ not(parameters.isWasmOnlyBuild) }} alwaysRun: ${{ variables.isRollingBuild }} scenarios: - - WasmTestOnV8 + - WasmTestOnWasmtime # Hybrid Globalization tests - template: /eng/pipelines/common/templates/wasm-library-tests.yml diff --git a/src/mono/wasm/Wasm.Build.Tests/Common/ToolCommand.cs b/src/mono/wasm/Wasm.Build.Tests/Common/ToolCommand.cs index eb2b80302b1161..c8289da17350d6 100644 --- a/src/mono/wasm/Wasm.Build.Tests/Common/ToolCommand.cs +++ b/src/mono/wasm/Wasm.Build.Tests/Common/ToolCommand.cs @@ -107,7 +107,7 @@ private async Task ExecuteAsyncInternal(string executable, string { var output = new List(); CurrentProcess = CreateProcess(executable, args); - CurrentProcess.ErrorDataReceived += (s, e) => + DataReceivedEventHandler errorHandler = (s, e) => { if (e.Data == null) return; @@ -118,7 +118,7 @@ private async Task ExecuteAsyncInternal(string executable, string ErrorDataReceived?.Invoke(s, e); }; - CurrentProcess.OutputDataReceived += (s, e) => + DataReceivedEventHandler outputHandler = (s, e) => { if (e.Data == null) return; @@ -129,11 +129,17 @@ private async Task ExecuteAsyncInternal(string executable, string OutputDataReceived?.Invoke(s, e); }; + CurrentProcess.ErrorDataReceived += errorHandler; + CurrentProcess.OutputDataReceived += outputHandler; + var completionTask = CurrentProcess.StartAndWaitForExitAsync(); CurrentProcess.BeginOutputReadLine(); CurrentProcess.BeginErrorReadLine(); await completionTask; + CurrentProcess.ErrorDataReceived -= errorHandler; + CurrentProcess.OutputDataReceived -= outputHandler; + RemoveNullTerminator(output); return new CommandResult(