Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion eng/pipelines/runtime-extra-platforms-wasm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,7 @@ IAsyncEnumerable<int> 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 })
Expand Down
13 changes: 12 additions & 1 deletion src/libraries/tests.proj
Original file line number Diff line number Diff line change
Expand Up @@ -378,10 +378,21 @@
</ItemGroup>

<ItemGroup Condition="'$(TargetOS)' == 'Browser' and '$(WasmEnableThreads)' == 'true' and '$(RunDisabledWasmTests)' != 'true'">
<!-- https://github.com/dotnet/runtime/issues/72101 -->
<!-- Issue: https://github.com/dotnet/runtime/issues/72101 -->
<ProjectExclusions Include="$(MSBuildThisFileDirectory)System.Text.Json\tests\System.Text.Json.SourceGeneration.Tests\System.Text.Json.SourceGeneration.Roslyn3.11.Tests.csproj" />
<ProjectExclusions Include="$(MSBuildThisFileDirectory)System.Text.Json\tests\System.Text.Json.SourceGeneration.Tests\System.Text.Json.SourceGeneration.Roslyn4.0.Tests.csproj" />
<ProjectExclusions Include="$(MSBuildThisFileDirectory)System.Text.Json\tests\System.Text.Json.Tests\System.Text.Json.Tests.csproj" />
<!-- Issue: https://github.com/dotnet/runtime/issues/74411 -->
<ProjectExclusions Include="$(MSBuildThisFileDirectory)System.Net.Http\tests\FunctionalTests\System.Net.Http.Functional.Tests.csproj" />
<!-- Issue: https://github.com/dotnet/runtime/issues/74413 -->
<ProjectExclusions Include="$(MSBuildThisFileDirectory)System.Net.WebSockets.Client\tests\System.Net.WebSockets.Client.Tests.csproj" />
</ItemGroup>

<ItemGroup Condition="'$(TargetOS)' == 'Browser' and '$(WasmEnablePerfTracing)' == 'true' and '$(RunDisabledWasmTests)' != 'true'">
<!-- Issue: https://github.com/dotnet/runtime/issues/74411 -->
<ProjectExclusions Include="$(MSBuildThisFileDirectory)System.Net.Http\tests\FunctionalTests\System.Net.Http.Functional.Tests.csproj" />
<!-- Issue: https://github.com/dotnet/runtime/issues/74413 -->
<ProjectExclusions Include="$(MSBuildThisFileDirectory)System.Net.WebSockets.Client\tests\System.Net.WebSockets.Client.Tests.csproj" />
</ItemGroup>

<!-- Aggressive Trimming related failures -->
Expand Down
6 changes: 3 additions & 3 deletions src/mono/sample/wasm/DefaultBrowserSample.targets
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@
<DebugType>embedded</DebugType>
<WasmDebugLevel>1</WasmDebugLevel>
<GenerateRunScriptForSample Condition="'$(ArchiveTests)' == 'true'">true</GenerateRunScriptForSample>
<RunScriptCommand>$(ExecXHarnessCmd) wasm test-browser --app=. --browser=Chrome $(XHarnessBrowserPathArg) --html-file=index.html --output-directory=$(XHarnessOutput) -- $(MSBuildProjectName).dll</RunScriptCommand>
<RunScriptCommand>$(ExecXHarnessCmd) wasm test-browser --app=. --browser=Chrome $(XHarnessBrowserPathArg) $(WasmXHarnessArgs) --html-file=index.html --output-directory=$(XHarnessOutput) -- $(MSBuildProjectName).dll</RunScriptCommand>
</PropertyGroup>

<ItemGroup>
<WasmExtraFilesToDeploy Include="index.html" />
</ItemGroup>

<Target Name="RunSample" DependsOnTargets="RunSampleWithBrowser" />
</Project>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
</Target>

<PropertyGroup>
<MonoDiagnosticsMock Condition="('$(MonoDiagnosticsMock)' == '') and ('$(Configuration)' == 'Debug')">true</MonoDiagnosticsMock>
<MonoDiagnosticsMock Condition="('$(MonoDiagnosticsMock)' == '') and ('$(Configuration)' == 'Debug' or '$(ArchiveTests)' == 'true')">true</MonoDiagnosticsMock>
</PropertyGroup>

<ItemGroup>
Expand All @@ -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)"
}' />
<!-- this option requires compiling the runtime with /p:MonoDiagnosticsMock=true and also building this project with the same property-->
<WasmExtraConfig Condition="'$(MonoDiagnosticsMock)' == 'true'" Include="environmentVariables" Value='
{
"MONO_LOG_LEVEL": "warning",
"MONO_LOG_MASK": "all",
"DOTNET_DiagnosticPorts": "mock:./mock.js,suspend"
"DOTNET_DiagnosticPorts": "mock:./mock.js,suspend",
"CI_TEST": "$(ArchiveTests)"
}' />
</ItemGroup>

Expand Down
21 changes: 19 additions & 2 deletions src/mono/sample/wasm/browser-eventpipe/main.js
Original file line number Diff line number Diff line change
@@ -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))

Expand Down Expand Up @@ -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;

Expand All @@ -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();