Skip to content

Enable out-of-process tests for CoreCLR browser WASM#131110

Draft
radekdoulik wants to merge 1 commit into
dotnet:mainfrom
radekdoulik:radekdoulik-coreclr-wasm-oop-tests
Draft

Enable out-of-process tests for CoreCLR browser WASM#131110
radekdoulik wants to merge 1 commit into
dotnet:mainfrom
radekdoulik:radekdoulik-coreclr-wasm-oop-tests

Conversation

@radekdoulik

Copy link
Copy Markdown
Member

Summary

  • Add a planning mode to merged runtime-test runners that selects RequiresProcessIsolation tests using the existing filter and stripe logic.
  • Run the selected tests from the host shell or command script through their existing per-test wrappers, avoiding browser fork support and Node-specific process APIs.
  • Import the child-wrapper results into the final merged xUnit report through a versioned, per-run-token result format.
  • Enable the orchestration marker only for CoreCLR browser-WASM merged runners.

Design

The browser runner executes three phases:

  1. The managed merged runner writes the selected out-of-process assembly paths.
  2. The host script runs each existing wrapper in a fresh child process and records its exit code and output.
  3. The managed runner executes its normal tests and imports the precomputed out-of-process results.

Existing wrappers remain responsible for test-specific environment variables, pre/post commands, expected exit codes, and per-child timeouts. Missing plans, wrappers, results, malformed records, or stale result tokens fail closed.

Validation

  • Built the complete CoreCLR browser-WASM priority-0 test graph.
  • Exercised native and browser plan/import success and failure paths, filtering, striping, environment-sensitive wrappers, missing markers/results, and refreshed Helix payloads.
  • Rebuilt and reran the final reflection browser OOP runner after the shell robustness fixes.
  • Priority-0 audit of unique OOP entries: 550 selected, 477 passed, and 73 failed.
  • Existing non-OOP results: 2,988 passed, 0 failed, and 491 skipped; the GC.GC merged runner exceeded its aggregate timeout before producing its final report.
  • Generated Bash scripts pass syntax checks. Generated Windows command scripts were inspected but have not yet been executed on Windows.

Draft follow-up work

This PR is intentionally a base for incremental follow-up work:

  • Exclude helper projects and tests that do not apply to browser-WASM.
  • Address the aggregate merged-runner timeout and consider parallel host scheduling of OOP children.
  • Adapt InterpreterTester to launch its child through this host-side path.
  • Add per-test native assets, UCO, and relinking support later.
  • Triage the meaningful browser-WASM failures and make currently vacuous/skipped test groups provide real signal.

Note

This pull request description was created with GitHub Copilot.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 44f4b4ea-409c-4a52-89a0-f488a89488b9
Copilot AI review requested due to automatic review settings July 20, 2026 22:14
@github-actions github-actions Bot added the area-Infrastructure-coreclr Only use for closed issues label Jul 20, 2026
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 3 pipeline(s).
13 pipeline(s) were filtered out due to trigger conditions.
There may be pipelines that require an authorized user to comment /azp run to run.

@radekdoulik radekdoulik added the arch-wasm WebAssembly architecture label Jul 20, 2026
@dotnet-policy-service

Copy link
Copy Markdown
Contributor

Tagging subscribers to 'arch-wasm': @lewing, @pavelsavara
See info in area-owners.md if you want to be subscribed.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR extends the CoreCLR browser-WASM test execution pipeline to support “out-of-process” (process-isolated) tests by adding a plan+execute orchestration flow: the merged managed runner can emit an OOP plan, host-side scripts run the existing per-test wrappers in fresh processes, and the merged runner then imports the precomputed wrapper results during the main test run.

Changes:

  • Add a build-time marker file (*.HasOutOfProcessTests) for CoreCLR browser merged runners that have OOP tests.
  • Update the merged runner codegen to support a “planning mode” (write OOP assembly paths instead of executing) and to route OOP tests through a precomputed-result import path on Browser.
  • Update browser Windows (.cmd) and Unix (.sh) execution scripts to run the plan phase, execute OOP wrappers, write versioned result files with a per-run token, then run the merged runner to import results.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
src/tests/Common/XUnitWrapperGenerator/XUnitWrapperGenerator.props Writes a HasOutOfProcessTests marker for CoreCLR+browser merged runners that contain OOP tests.
src/tests/Common/XUnitWrapperGenerator/XUnitWrapperGenerator.cs Emits new generated-runner behavior: per-test executors with an optional plan-writer parameter; planning mode for OOP selection; Browser guard when orchestration is missing.
src/tests/Common/XUnitWrapperGenerator/ITestInfo.cs Adds plan-writing support to the reporting wrapper; exposes OOP assembly path for plan emission.
src/tests/Common/CoreCLRTestLibrary/OutOfProcessTest.cs Adds env-var plumbing and precomputed-result import so Browser can “run” OOP tests without forking.
src/tests/Common/CLRTest.Execute.Batch.targets Adds Windows browser orchestration: plan phase, wrapper execution, result-file generation, then merged runner import phase.
src/tests/Common/CLRTest.Execute.Bash.targets Adds Unix browser orchestration mirroring the batch logic: plan, run wrappers, write result files, then run merged runner to import.


private CodeBuilder _executionStatement { get; }
private string RelativeAssemblyPath { get; }
public string RelativeAssemblyPath { get; }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

arch-wasm WebAssembly architecture area-Infrastructure-coreclr Only use for closed issues

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

2 participants