Uh oh!
There was an error while loading. Please reload this page.
[wasm] Wasm.Build.Tests: add support for shared builds - #49398
Conversation
ghost
commented
Mar 9, 2021
Tagging subscribers to this area: @directhex Issue Details
|
ghost
commented
Mar 9, 2021
Tagging subscribers to 'arch-wasm': @lewing Issue Details
|
3f95a20 to
78840c3Compare5a03409 to
cedeecaCompareradical
commented
Mar 11, 2021
This will be rebased once #49446 is merged. |
cedeeca to
2dbfc6aCompare- 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
fcf0da6Compareradical
commented
Mar 12, 2021
Unrelated test failures. |
steveisok
left a comment
There was a problem hiding this comment.
LGTM. I'm curious the average helix run time w/ these changes.
radical
commented
Mar 16, 2021
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 |
radical
commented
Mar 16, 2021
Repeatedly getting test run failures: .. tracked in https://github.com/dotnet/core-eng/issues/12499 . |
radical
commented
Mar 17, 2021
Added a few more tests, and some cleanup. |
radical
commented
Mar 26, 2021
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.
radical
commented
Mar 26, 2021
@akoeplinger with your suggested change (7caed5a) it ran in 43mins, instead of 59! 👍 |
radical
commented
Mar 26, 2021
@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,
SharedBuildClassFixtureis 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.ictartifacts/bin/Wasm.Build.Tests/net6.0-Release/browser-wasm/xharness-output/logs/n1xwbqxi.ict/Chrome/split
WasmBuildAppTest.csinto :BuildTestBase.cs, andMainWithArgsTests.cs.Note: In interest of lowering test run times, this builds the tests in
Releaseconfig only, on CI.But when running the tests locally, both
Debug, andReleaseconfigs are used.