[runtime tests] Make 5 tests conditional on multithreading support#126357
Merged
radekdoulik merged 1 commit intodotnet:mainfrom Apr 1, 2026
Merged
[runtime tests] Make 5 tests conditional on multithreading support#126357radekdoulik merged 1 commit intodotnet:mainfrom
radekdoulik merged 1 commit intodotnet:mainfrom
Conversation
Contributor
|
Tagging subscribers to this area: @agocke, @dotnet/runtime-infrastructure |
Disable tests that call Thread.Start() on single-threaded platforms (e.g., browser WASM) by using ConditionalFact with PlatformDetection.IsMultithreadingSupported. Tests changed: - finally_SEH (baseservices/exceptions) - rethrow (baseservices/exceptions) - Polyrec (Loader/regressions) - test1 (Loader/TypeInitialization/backpatching) - InterlockExchange (Regressions) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
c67b6c2 to
a9a776a
Compare
Contributor
There was a problem hiding this comment.
Pull request overview
This PR aims to avoid failures on single-threaded platforms (e.g., browser WASM) by skipping a small set of tests that unconditionally call Thread.Start(). In addition, the PR includes CoreCLR VM changes related to portable entrypoints/interpreter behavior and interpreter frame allocation alignment.
Changes:
- Convert 5 thread-spawning tests from
[Fact]to[ConditionalFact(...IsMultithreadingSupported)]and addTestLibraryreferences where needed. - Add
$(TestLibraryProjectPath)project references to affected test projects. - Update CoreCLR VM interpreter/portable-entrypoint logic and adjust interpreter frame allocation to use aligned allocation.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| src/tests/Regressions/coreclr/1514/interlockexchange.cs | Skip thread-heavy regression test when multithreading isn’t supported. |
| src/tests/Loader/regressions/polyrec/Polyrec.csproj | Add TestLibrary project reference for PlatformDetection usage. |
| src/tests/Loader/regressions/polyrec/polyrec.cs | Gate polymorphic recursion multithreaded test behind multithreading support. |
| src/tests/Loader/classloader/TypeInitialization/backpatching/test1.cs | Skip type-init race test on single-threaded platforms. |
| src/tests/baseservices/exceptions/regressions/V1/SEH/COOL/rethrow.csproj | Add TestLibrary project reference for PlatformDetection usage. |
| src/tests/baseservices/exceptions/regressions/V1/SEH/COOL/rethrow.cs | Gate thread-based rethrow test behind multithreading support. |
| src/tests/baseservices/exceptions/regressions/V1/SEH/COOL/finally.cs | Gate thread-based finally/SEH regression test behind multithreading support. |
| src/tests/baseservices/exceptions/regressions/V1/SEH/COOL/finally_SEH.csproj | Add TestLibrary project reference for PlatformDetection usage. |
| src/coreclr/vm/method.cpp | Adjust ShouldCallPrestub entrypoint selection for MethodImpl/.override + portable entrypoints. |
| src/coreclr/vm/interpframeallocator.cpp | Use aligned allocation/free and align interpreter allocations to INTERP_STACK_ALIGNMENT. |
| src/coreclr/vm/interpexec.cpp | Add interpreter code-prep fallback for MethodImpl/.override vtable-slot remapping scenarios. |
jkotas
approved these changes
Mar 31, 2026
jkoritzinsky
approved these changes
Mar 31, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Note
This PR description was generated with the help of GitHub Copilot.
Disable tests that call
Thread.Start()on single-threaded platforms (e.g., browser WASM) by usingConditionalFactwithPlatformDetection.IsMultithreadingSupported.These tests unconditionally create and start new threads, which fails on single-threaded WASM where
Thread.Start()is not supported.Tests changed
baseservices/exceptions) — spawns thread in finally blockbaseservices/exceptions) — spawns threads for exception rethrow testingLoader/regressions) — spawns 4 threads for polymorphic recursionLoader/TypeInitialization/backpatching) — spawns threads for static constructor raceRegressions) — spawns 99 threads for interlocked opsChanges
[Fact]→[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))]using TestLibrary;and<ProjectReference Include="$(TestLibraryProjectPath)" />where not already present