Skip to content

Commit 286492c

Browse files
authored
[wasm][aot] Run the high resource AOT tests on build machine itself (#67017)
Some library tests fail to AOT on helix by getting oomkill'ed. Since the build machine have more resources than helix, we can AOT these specific library tests there, and send the built output to helix to run. Specifically: - `System.Text.Json.SourceGeneration.Roslyn3.11.Tests` - `System.Text.Json.SourceGeneration.Roslyn4.0.Tests` - `System.Text.Json.Tests` - `Microsoft.Extensions.Logging.Generators.Roslyn3.11.Tests` This adds two new jobs to `runtime-wasm`, and for rolling builds - `LibraryTests_HighResource_AOT` for linux, and windows. Fixes #65356 Fixes #65411 Fixes #61524 Fixes #66647
1 parent cc4d26d commit 286492c

File tree

6 files changed

+73
-18
lines changed

6 files changed

+73
-18
lines changed

eng/pipelines/common/global-build-job.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,6 @@ jobs:
113113
${{ if ne(parameters.buildingOnSourceBuildImage, true) }}:
114114
value: ''
115115

116-
117116
- ${{ each variable in parameters.variables }}:
118117
- ${{ variable }}
119118

@@ -192,6 +191,9 @@ jobs:
192191
inputs:
193192
PathtoPublish: '$(Build.SourcesDirectory)/artifacts/log/'
194193
PublishLocation: Container
195-
ArtifactName: Logs_Build_${{ parameters.osGroup }}_${{ parameters.osSubGroup }}_${{ parameters.archType }}_${{ parameters.buildConfig }}_${{ parameters.nameSuffix }}
194+
${{ if ne(parameters.osGroup, 'Browser') }}:
195+
ArtifactName: Logs_Build_${{ parameters.osGroup }}_${{ parameters.osSubGroup }}_${{ parameters.archType }}_${{ parameters.buildConfig }}_${{ parameters.nameSuffix }}
196+
${{ if eq(parameters.osGroup, 'Browser') }}:
197+
ArtifactName: Logs_Build_Browser_wasm_${{ parameters.hostedOs }}_${{ parameters.buildConfig }}_${{ parameters.nameSuffix }}
196198
continueOnError: true
197199
condition: always()

eng/pipelines/common/templates/wasm-library-aot-tests.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ parameters:
33
extraBuildArgs: ''
44
extraHelixArgs: ''
55
isExtraPlatformsBuild: false
6+
buildAOTOnHelix: true
67
nameSuffix: ''
78
platforms: []
89
runAOT: false
@@ -18,7 +19,7 @@ jobs:
1819
platforms: ${{ parameters.platforms }}
1920
nameSuffix: ${{ parameters.nameSuffix }}
2021
isExtraPlatforms: ${{ parameters.isExtraPlatformsBuild }}
21-
extraBuildArgs: /p:EnableAggressiveTrimming=true /p:BuildAOTTestsOnHelix=true /p:RunAOTCompilation=${{ parameters.runAOT }} ${{ parameters.extraBuildArgs }}
22+
extraBuildArgs: /p:EnableAggressiveTrimming=true /p:BuildAOTTestsOnHelix=${{ parameters.buildAOTOnHelix }} /p:RunAOTCompilation=${{ parameters.runAOT }} ${{ parameters.extraBuildArgs }}
2223
extraHelixArgs: /p:NeedsToBuildWasmAppsOnHelix=true ${{ parameters.extraHelixArgs }}
2324
alwaysRun: ${{ parameters.alwaysRun }}
2425
runSmokeOnlyArg: $(_runSmokeTestsOnlyArg)

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

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,18 @@ jobs:
3434
runAOT: true
3535
alwaysRun: true
3636

37+
# High resource AOT Library tests
38+
- template: /eng/pipelines/common/templates/wasm-library-aot-tests.yml
39+
parameters:
40+
platforms:
41+
- Browser_wasm
42+
- Browser_wasm_win
43+
nameSuffix: _HighResource_AOT
44+
extraBuildArgs: /p:TestAssemblies=false /p:RunHighAOTResourceRequiringTestsOnly=true
45+
buildAOTOnHelix: false
46+
runAOT: true
47+
alwaysRun: true
48+
3749
#
3850
# ********** For !rolling builds, IOW - PR builds *************
3951
# - run everything, if relevant paths changed
@@ -72,6 +84,18 @@ jobs:
7284
runAOT: true
7385
alwaysRun: ${{ parameters.isWasmOnlyBuild }}
7486

87+
# High resource AOT Library tests
88+
- template: /eng/pipelines/common/templates/wasm-library-aot-tests.yml
89+
parameters:
90+
platforms:
91+
- Browser_wasm
92+
- Browser_wasm_win
93+
nameSuffix: _HighResource_AOT
94+
extraBuildArgs: /p:TestAssemblies=false /p:RunHighAOTResourceRequiringTestsOnly=true
95+
buildAOTOnHelix: false
96+
runAOT: true
97+
alwaysRun: ${{ parameters.isWasmOnlyBuild }}
98+
7599
# Wasm.Build.Tests
76100
- template: /eng/pipelines/common/templates/wasm-build-tests.yml
77101
parameters:

eng/testing/tests.wasm.targets

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@
55
<WasmGenerateAppBundle Condition="'$(WasmGenerateAppBundle)' == ''">true</WasmGenerateAppBundle>
66
<BundleTestAppTargets>$(BundleTestAppTargets);BundleTestWasmApp</BundleTestAppTargets>
77
<DebuggerSupport Condition="'$(DebuggerSupport)' == '' and '$(Configuration)' == 'Debug'">true</DebuggerSupport>
8+
9+
<!-- set this when provisioning emsdk on CI -->
10+
<EMSDK_PATH Condition="'$(EMSDK_PATH)' == '' and '$(ContinuousIntegrationBuild)' == 'true' and '$(MonoProjectRoot)' != ''">$([MSBuild]::NormalizeDirectory($(MonoProjectRoot), 'wasm', 'emsdk'))</EMSDK_PATH>
11+
812
<!-- Some tests expect to load satellite assemblies by path, eg. System.Runtime.Loader.Tests,
913
so, just setting it true by default -->
1014
<IncludeSatelliteAssembliesInVFS Condition="'$(IncludeSatelliteAssembliesInVFS)' == ''">true</IncludeSatelliteAssembliesInVFS>

src/libraries/tests.proj

Lines changed: 33 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,28 @@
1818
<TestAssemblies Condition="'$(TestAssemblies)' == ''">true</TestAssemblies>
1919
<TestPackages Condition="'$(TestPackages)' == ''">false</TestPackages>
2020
<TestTrimming Condition="'$(TestTrimming)' == ''">false</TestTrimming>
21+
22+
<RunHighAOTResourceRequiringTestsOnly Condition="'$(RunHighAOTResourceRequiringTestsOnly)' == ''">false</RunHighAOTResourceRequiringTestsOnly>
23+
24+
<!-- Don't build samples, and functional tests on EAT, AOT, WBT, and Debugger lanes -->
25+
<RunWasmSamples Condition="'$(RunSmokeTestsOnly)' != 'true' and '$(RunHighAOTResourceRequiringTestsOnly)' != 'true' and '$(TargetOS)' == 'Browser' and '$(BuildAOTTestsOnHelix)' != 'true' and '$(TestWasmBuildTests)' != 'true' and '$(TestWasmDebuggerTests)' != 'true'">true</RunWasmSamples>
2126
</PropertyGroup>
2227

28+
<ItemGroup Condition="'$(TargetOS)' == 'Browser'">
29+
<!-- https://github.com/dotnet/runtime/issues/65356 - OOM while linking -->
30+
<HighAOTResourceRequiringProject Include="$(MSBuildThisFileDirectory)System.Text.Json\tests\System.Text.Json.SourceGeneration.Tests\System.Text.Json.SourceGeneration.Roslyn3.11.Tests.csproj" />
31+
32+
<!-- https://github.com/dotnet/runtime/issues/65411 - possible OOM when compiling
33+
System.Text.Json.SourceGeneration.Roslyn4.0.Tests.dll.bc -> .o -->
34+
<HighAOTResourceRequiringProject Include="$(MSBuildThisFileDirectory)System.Text.Json\tests\System.Text.Json.SourceGeneration.Tests\System.Text.Json.SourceGeneration.Roslyn4.0.Tests.csproj" />
35+
36+
<!-- https://github.com/dotnet/runtime/issues/61524 - OOM while linking -->
37+
<HighAOTResourceRequiringProject Include="$(MSBuildThisFileDirectory)System.Text.Json\tests\System.Text.Json.Tests\System.Text.Json.Tests.csproj" />
38+
39+
<!-- https://github.com/dotnet/runtime/issues/66647 -->
40+
<HighAOTResourceRequiringProject Include="$(MSBuildThisFileDirectory)Microsoft.Extensions.Logging.Abstractions\tests\Microsoft.Extensions.Logging.Generators.Tests\Microsoft.Extensions.Logging.Generators.Roslyn3.11.Tests.csproj" />
41+
</ItemGroup>
42+
2343
<!-- Samples which are too complex for CI -->
2444
<ItemGroup Condition="'$(TargetOS)' == 'Browser'">
2545
<ProjectExclusions Include="$(MonoProjectRoot)sample\wasm\console-node-ts\Wasm.Console.Node.TS.Sample.csproj" />
@@ -37,15 +57,6 @@
3757

3858
<!-- https://github.com/dotnet/runtime/issues/61756 -->
3959
<ProjectExclusions Include="$(MSBuildThisFileDirectory)System.Text.RegularExpressions\tests\FunctionalTests\System.Text.RegularExpressions.Tests.csproj" />
40-
41-
<!-- https://github.com/dotnet/runtime/issues/65356 - OOM while linking -->
42-
<ProjectExclusions Include="$(MSBuildThisFileDirectory)System.Text.Json\tests\System.Text.Json.SourceGeneration.Tests\System.Text.Json.SourceGeneration.Roslyn3.11.Tests.csproj" />
43-
<!-- https://github.com/dotnet/runtime/issues/65411 - possible OOM when compiling
44-
System.Text.Json.SourceGeneration.Roslyn4.0.Tests.dll.bc -> .o -->
45-
<ProjectExclusions Include="$(MSBuildThisFileDirectory)System.Text.Json\tests\System.Text.Json.SourceGeneration.Tests\System.Text.Json.SourceGeneration.Roslyn4.0.Tests.csproj" />
46-
47-
<!-- https://github.com/dotnet/runtime/issues/61524 - OOM while linking -->
48-
<ProjectExclusions Include="$(MSBuildThisFileDirectory)System.Text.Json\tests\System.Text.Json.Tests\System.Text.Json.Tests.csproj" />
4960
</ItemGroup>
5061

5162
<!-- Projects that don't support code coverage measurement. -->
@@ -365,11 +376,20 @@
365376
<ProjectExclusions Remove="$(MSBuildThisFileDirectory)System.Collections\tests\System.Collections.Tests.csproj" />
366377
</ItemGroup>
367378

368-
<ItemGroup Condition="'$(RunSmokeTestsOnly)' == 'true'">
369-
<ProjectReference Include="$(MSBuildThisFileDirectory)System.Runtime\tests\System.Runtime.Tests.csproj" />
379+
<ItemGroup>
380+
<ProjectExclusions Condition="'$(RunHighAOTResourceRequiringTestsOnly)' != 'true'"
381+
Include="@(HighAOTResourceRequiringProject)" />
382+
</ItemGroup>
383+
384+
<ItemGroup>
385+
<ProjectReference Condition="'$(RunSmokeTestsOnly)' == 'true'"
386+
Include="$(MSBuildThisFileDirectory)System.Runtime\tests\System.Runtime.Tests.csproj" />
387+
<ProjectReference Condition="'$(RunHighAOTResourceRequiringTestsOnly)' == 'true'"
388+
Include="@(HighAOTResourceRequiringProject)"
389+
BuildInParallel="false" />
370390
</ItemGroup>
371391

372-
<ItemGroup Condition="'$(RunSmokeTestsOnly)' != 'true'">
392+
<ItemGroup Condition="'$(RunSmokeTestsOnly)' != 'true' and '$(RunHighAOTResourceRequiringTestsOnly)' != 'true'">
373393
<ProjectReference Include="$(MSBuildThisFileDirectory)*\tests\**\*.Tests.csproj"
374394
Exclude="@(ProjectExclusions)"
375395
Condition="'$(TestAssemblies)' == 'true'" />
@@ -448,8 +468,7 @@
448468
<Samples_BuildInParallel Condition="'$(OS)' != 'Windows_NT'">true</Samples_BuildInParallel>
449469
</PropertyGroup>
450470

451-
<!-- Don't build samples, and functional tests on EAT, AOT, WBT, and Debugger lanes -->
452-
<ItemGroup Condition="'$(ArchiveTests)' == 'true' and '$(RunSmokeTestsOnly)' != 'true' and '$(TargetOS)' == 'Browser' and '$(BuildAOTTestsOnHelix)' != 'true' and '$(TestWasmBuildTests)' != 'true' and '$(TestWasmDebuggerTests)' != 'true'">
471+
<ItemGroup Condition="'$(ArchiveTests)' == 'true' and '$(RunWasmSamples)' == 'true'">
453472
<ProjectReference Include="$(MonoProjectRoot)sample\wasm\**\*.Sample.csproj"
454473
Exclude="@(ProjectExclusions)"
455474
BuildInParallel="$(Samples_BuildInParallel)" />

src/mono/wasm/README.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,11 +215,13 @@ Bumping Emscripten version involves these steps:
215215
| libtests | linux: all, only-pc | windows: all, only-pc | linux+windows: all, only-pc | linux+windows: all, always |
216216
| libtests eat | linux: smoke, only-pc | - | linux: all, only-pc | linux: all, always |
217217
| libtests aot | linux: smoke, only-pc | windows: smoke, only-pc | linux+windows: all, only-pc | linux+windows: all, always |
218-
| | | | | |
218+
| high resource aot | none | none | linux+windows: all, only-pc | linux+windows: all, always |
219219
| Wasm.Build.Tests | linux: only-pc | windows: only-pc | linux+windows: only-pc | linux+windows |
220220
| Debugger tests | - | linux+windows: only-pc | linux+windows: only-pc | linux+windows |
221221
| Runtime tests | linux: only-pc | - | linux: only-pc | linux |
222222

223+
* `high resource aot` runs a few specific library tests with AOT, that require more memory to AOT.
224+
223225
## Rolling build (twice a day):
224226

225227
* `runtime`, and `runtime-staging`, run all the wasm jobs unconditionally, but `EAT`, and `AOT` still run only smoke tests.
@@ -232,7 +234,10 @@ Bumping Emscripten version involves these steps:
232234
| libtests | linux: all(v8/chr) | windows: all | none | N/A |
233235
| libtests eat | linux: smoke | - | linux: all | |
234236
| libtests aot | linux: smoke | windows: smoke | linux+windows: all | |
237+
| high resource aot | none | none | linux+windows: all | |
235238
| | | | | |
236239
| Wasm.Build.Tests | linux: always | windows: always | none | |
237240
| Debugger tests | - | linux+windows: always | none | |
238241
| Runtime tests | linux: always | - | none | |
242+
243+
* `high resource aot` runs a few specific library tests with AOT, that require more memory to AOT.

0 commit comments

Comments
 (0)