Skip to content

Commit 80dbd69

Browse files
authored
[browser][wbt] Fix InvalidOperationException: There is no currently active test (#105561)
* Unsubscribe from event handlers * Fix wasi default scenario
1 parent fd2b245 commit 80dbd69

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

eng/pipelines/extra-platforms/runtime-extra-platforms-wasm.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ jobs:
185185
shouldContinueOnError: ${{ not(parameters.isWasmOnlyBuild) }}
186186
alwaysRun: ${{ variables.isRollingBuild }}
187187
scenarios:
188-
- WasmTestOnV8
188+
- WasmTestOnWasmtime
189189

190190
# Hybrid Globalization tests
191191
- template: /eng/pipelines/common/templates/wasm-library-tests.yml

src/mono/wasm/Wasm.Build.Tests/Common/ToolCommand.cs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ private async Task<CommandResult> ExecuteAsyncInternal(string executable, string
107107
{
108108
var output = new List<string>();
109109
CurrentProcess = CreateProcess(executable, args);
110-
CurrentProcess.ErrorDataReceived += (s, e) =>
110+
DataReceivedEventHandler errorHandler = (s, e) =>
111111
{
112112
if (e.Data == null)
113113
return;
@@ -118,7 +118,7 @@ private async Task<CommandResult> ExecuteAsyncInternal(string executable, string
118118
ErrorDataReceived?.Invoke(s, e);
119119
};
120120

121-
CurrentProcess.OutputDataReceived += (s, e) =>
121+
DataReceivedEventHandler outputHandler = (s, e) =>
122122
{
123123
if (e.Data == null)
124124
return;
@@ -129,11 +129,17 @@ private async Task<CommandResult> ExecuteAsyncInternal(string executable, string
129129
OutputDataReceived?.Invoke(s, e);
130130
};
131131

132+
CurrentProcess.ErrorDataReceived += errorHandler;
133+
CurrentProcess.OutputDataReceived += outputHandler;
134+
132135
var completionTask = CurrentProcess.StartAndWaitForExitAsync();
133136
CurrentProcess.BeginOutputReadLine();
134137
CurrentProcess.BeginErrorReadLine();
135138
await completionTask;
136139

140+
CurrentProcess.ErrorDataReceived -= errorHandler;
141+
CurrentProcess.OutputDataReceived -= outputHandler;
142+
137143
RemoveNullTerminator(output);
138144

139145
return new CommandResult(

0 commit comments

Comments
 (0)