From 80e7c248b3820bfab0381125468efaa98ddbd70f Mon Sep 17 00:00:00 2001 From: Meri Khamoyan Date: Fri, 26 Jul 2024 15:29:25 +0200 Subject: [PATCH 1/2] unsubscribe from event handlers --- src/mono/wasm/Wasm.Build.Tests/Common/ToolCommand.cs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) 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( From 1900e2dc5b6e67eda0a0a893a03e67c636643446 Mon Sep 17 00:00:00 2001 From: Meri Khamoyan Date: Tue, 30 Jul 2024 12:27:53 +0200 Subject: [PATCH 2/2] Fix wasi default scenario --- eng/pipelines/extra-platforms/runtime-extra-platforms-wasm.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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