-
Notifications
You must be signed in to change notification settings - Fork 4.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[wasm] Wasm.Build.Tests: add support for shared builds #49398
Conversation
Tagging subscribers to this area: @directhex Issue Details
|
Tagging subscribers to 'arch-wasm': @lewing Issue Details
|
3f95a20
to
78840c3
Compare
5a03409
to
cedeeca
Compare
This will be rebased once #49446 is merged. |
cedeeca
to
2dbfc6a
Compare
- Essentially, we want to share builds wherever possible. Example cases: - Same build, but run with different hosts like v8/chrome/safari, as separate test runs - Same build but run with different command line arguments - Sharing builds especially helps when we are AOT'ing, which is slow! - This is done by caching the builds with the key: `public record BuildArgs(string ProjectName, string Config, bool AOT, string ProjectFileContents, string? ExtraBuildArgs);` - Also, ` SharedBuildClassFixture` is added, so that the builds can be cleaned up after all the tests in a particular class have finished running. - Each test run gets a randomly generated test id. This is used for creating: 1. build paths, like `artifacts/bin/Wasm.Build.Tests/net6.0-Release/browser-wasm/xharness-output/logs/n1xwbqxi.ict` 2. and the log for running with xharness, eg. for Chrome, are in `artifacts/bin/Wasm.Build.Tests/net6.0-Release/browser-wasm/xharness-output/logs/n1xwbqxi.ict/Chrome/` - split `WasmBuildAppTest.cs` into : `BuildTestBase.cs`, and `MainWithArgsTests.cs`.
.. tests. Code stolen from @maximlipin's dotnet#49204
For AOT we generate `pinvoke-table.h` in the obj directory. But there is one present in the runtime pack too. In my earlier changes the order in which these were passed as include search paths was changed from: `"-I/runtime/pack/microsoft.netcore.app.runtime.browser-wasm/Release/runtimes/browser-wasm/native/include/wasm" "-Iartifacts/obj/mono/Wasm.Console.Sample/wasm/Release/browser-wasm/wasm/"` .. which meant that the one from the runtime pack took precedence, and got used. So, fix the order! And change the property names to indicate where they are sourced from.
The environment variable is set on helix. During local testing it can be useful when using a locally built xharness.
808e761
to
fcf0da6
Compare
Unrelated test failures. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. I'm curious the average helix run time w/ these changes.
AFAICS, the test time stays at about 45mins. With this one we actually are building only Though when I look at the run times for the individual runs for wasm.build tests, they seem to be around ~25mins. |
The helix step runs in total 45mins when I looked at one of the earlier |
Repeatedly getting test run failures:
.. tracked in https://github.com/dotnet/core-eng/issues/12499 . |
Added a few more tests, and some cleanup. |
investigating the test run time |
TLDR; - this might help with the job getting scheduled first, and thus having a chance at completing at the same time as others. Reasoning: The problem this is trying to fix is: 1. The helix step submits 3 jobs: a. library tests to be run with v8 b. library tests to be run with browser (scenario=wasmtestonbrowser) c. Wasm.Build.Tests (scenario=buildwasmapps) 2. The 3 jobs, individually take roughly 30mins each 3. And they get submitted at roughly the same time 4. But .. the first two seem to complete earlier, and the 3rd one completes 25-30mins later. The hypothesis is that all the machines might be busy processing the 200+ work items from each of the first two steps, and so Wasm.Build.Tests get scheduled pretty late. So, here we move that to be submitted first, in the hope that it would be able to run in parallel with the other jobs.
@akoeplinger with your suggested change (7caed5a) it ran in 43mins, instead of 59! 👍 |
@lewing @steveisok this is ready for another look! And hopefully merge :D |
Essentially, we want to share builds wherever possible. Example cases:
separate test runs
Sharing builds especially helps when we are AOT'ing, which is slow!
This is done by caching the builds with the key:
public record BuildArgs(string ProjectName, string Config, bool AOT, string ProjectFileContents, string? ExtraBuildArgs);
Also,
SharedBuildClassFixture
is added, so that the builds can becleaned up after all the tests in a particular class have finished
running.
Each test run gets a randomly generated test id. This is used for
creating:
artifacts/bin/Wasm.Build.Tests/net6.0-Release/browser-wasm/xharness-output/logs/n1xwbqxi.ict
artifacts/bin/Wasm.Build.Tests/net6.0-Release/browser-wasm/xharness-output/logs/n1xwbqxi.ict/Chrome/
split
WasmBuildAppTest.cs
into :BuildTestBase.cs
, andMainWithArgsTests.cs
.Note: In interest of lowering test run times, this builds the tests in
Release
config only, on CI.But when running the tests locally, both
Debug
, andRelease
configs are used.