diff --git a/eng/pipelines/runtime-extra-platforms-wasm.yml b/eng/pipelines/runtime-extra-platforms-wasm.yml index 887d4be4e25959..5f28824c09a299 100644 --- a/eng/pipelines/runtime-extra-platforms-wasm.yml +++ b/eng/pipelines/runtime-extra-platforms-wasm.yml @@ -107,7 +107,7 @@ jobs: - Browser_wasm #- Browser_wasm_win nameSuffix: _Threading - extraBuildArgs: /p:WasmEnableThreads=true + extraBuildArgs: /p:WasmEnableThreads=true /p:_WasmPThreadPoolSize=8 isExtraPlatformsBuild: ${{ parameters.isExtraPlatformsBuild }} isWasmOnlyBuild: ${{ parameters.isWasmOnlyBuild }} # Always run for runtime-wasm because tests are not run in runtime diff --git a/src/libraries/System.Threading.Tasks.Dataflow/tests/Dataflow/TransformManyBlockTests.IAsyncEnumerable.cs b/src/libraries/System.Threading.Tasks.Dataflow/tests/Dataflow/TransformManyBlockTests.IAsyncEnumerable.cs index 7dcf4bdbfaebeb..5fcc146b29d1d6 100644 --- a/src/libraries/System.Threading.Tasks.Dataflow/tests/Dataflow/TransformManyBlockTests.IAsyncEnumerable.cs +++ b/src/libraries/System.Threading.Tasks.Dataflow/tests/Dataflow/TransformManyBlockTests.IAsyncEnumerable.cs @@ -163,6 +163,7 @@ IAsyncEnumerable body(int i) } [Fact] + [ActiveIssue("https://github.com/dotnet/runtime/issues/75389", TestPlatforms.Browser)] public async Task TestProducerConsumerAsyncEnumerable() { foreach (TaskScheduler scheduler in new[] { TaskScheduler.Default, new ConcurrentExclusiveSchedulerPair().ConcurrentScheduler }) diff --git a/src/libraries/tests.proj b/src/libraries/tests.proj index 1defbf332910a6..6ea3f13a2200b7 100644 --- a/src/libraries/tests.proj +++ b/src/libraries/tests.proj @@ -378,10 +378,21 @@ - + + + + + + + + + + + + diff --git a/src/mono/sample/wasm/DefaultBrowserSample.targets b/src/mono/sample/wasm/DefaultBrowserSample.targets index 1f11e12ccd1f01..33c52f98bda947 100644 --- a/src/mono/sample/wasm/DefaultBrowserSample.targets +++ b/src/mono/sample/wasm/DefaultBrowserSample.targets @@ -6,12 +6,12 @@ embedded 1 true - $(ExecXHarnessCmd) wasm test-browser --app=. --browser=Chrome $(XHarnessBrowserPathArg) --html-file=index.html --output-directory=$(XHarnessOutput) -- $(MSBuildProjectName).dll + $(ExecXHarnessCmd) wasm test-browser --app=. --browser=Chrome $(XHarnessBrowserPathArg) $(WasmXHarnessArgs) --html-file=index.html --output-directory=$(XHarnessOutput) -- $(MSBuildProjectName).dll - + - \ No newline at end of file + diff --git a/src/mono/sample/wasm/browser-eventpipe/Wasm.Browser.EventPipe.Sample.csproj b/src/mono/sample/wasm/browser-eventpipe/Wasm.Browser.EventPipe.Sample.csproj index 3a9cb75029156d..c7cfb7dc62236e 100644 --- a/src/mono/sample/wasm/browser-eventpipe/Wasm.Browser.EventPipe.Sample.csproj +++ b/src/mono/sample/wasm/browser-eventpipe/Wasm.Browser.EventPipe.Sample.csproj @@ -12,7 +12,7 @@ - true + true @@ -23,14 +23,16 @@ { "MONO_LOG_LEVEL": "warning", "MONO_LOG_MASK": "all", - "DOTNET_DiagnosticPorts": "ws://localhost:8088/diagnostics,suspend" + "DOTNET_DiagnosticPorts": "ws://localhost:8088/diagnostics,suspend", + "CI_TEST": "$(ArchiveTests)" }' /> diff --git a/src/mono/sample/wasm/browser-eventpipe/main.js b/src/mono/sample/wasm/browser-eventpipe/main.js index 36b13deddce7b2..8c931537ab7ee6 100644 --- a/src/mono/sample/wasm/browser-eventpipe/main.js +++ b/src/mono/sample/wasm/browser-eventpipe/main.js @@ -1,7 +1,7 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. -import { dotnet } from "./dotnet.js"; +import { dotnet, exit } from "./dotnet.js"; const delay = (ms) => new Promise((resolve) => setTimeout(resolve, ms)) @@ -43,8 +43,19 @@ function getOnClickHandler(startWork, stopWork, getIterationsDone) { } } +const isTest = (config) => config.environmentVariables["CI_TEST"] === "true"; +async function runTest({ StartAsyncWork, StopWork, GetIterationsDone }) { + const result = await doWork(StartAsyncWork, StopWork, GetIterationsDone); + const expectedResult = 55; // the default value of `inputN` is 10 (see index.html) + return result === expectedResult; +} + async function main() { - const { MONO, Module, getAssemblyExports } = await dotnet.create() + const { MONO, Module, getAssemblyExports, getConfig } = await dotnet + .withElementOnExit() + .withExitCodeLogging() + .create(); + globalThis.__Module = Module; globalThis.MONO = MONO; @@ -53,6 +64,12 @@ async function main() { const btn = document.getElementById("startWork"); btn.style.backgroundColor = "rgb(192,255,192)"; btn.onclick = getOnClickHandler(exports.Sample.Test.StartAsyncWork, exports.Sample.Test.StopWork, exports.Sample.Test.GetIterationsDone); + + const config = getConfig(); + if (isTest(config)) { + const succeeded = await runTest(exports.Sample.Test); + exit(succeeded ? 0 : 1); + } } main();