[clr-ios] Preserve inherited MemberData statics on maccatalyst CoreCLR#128409
[clr-ios] Preserve inherited MemberData statics on maccatalyst CoreCLR#128409kotlarmilos wants to merge 10 commits into
Conversation
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
/azp run runtime-extra-platforms |
|
Azure Pipelines successfully started running 1 pipeline(s). |
There was a problem hiding this comment.
Pull request overview
This PR adjusts a handful of library test cases to run (or skip) correctly on newly-enabled CoreCLR Apple mobile test legs by updating xUnit data discovery patterns and adding platform/trimming-related guards.
Changes:
- Add/adjust theory data sourcing to avoid xUnit
MemberDataresolution problems in derived/overridden conformance tests. - Skip or expand existing platform exclusions for tests that rely on desktop-only behaviors (e.g., TPA/fusion log details, reflection emit under aggressive trimming).
- Expand an existing
ActiveIssueto include MacCatalyst and gate a debugger-proxy test away from NativeAOT.
Show a summary per file
| File | Description |
|---|---|
| src/libraries/System.Security.Cryptography/tests/CryptoStream.cs | Adds an override using explicit MemberType for MemberData to stabilize conformance theory data discovery. |
| src/libraries/System.Runtime.Loader/tests/TpaLoadFailureTest.cs | Skips path/fusion-log validation tests on Apple mobile where the assumptions don’t hold. |
| src/libraries/System.Reflection.Metadata/tests/Metadata/Decoding/CustomAttributeDecoderTests.cs | Expands an ActiveIssue platform mask to include MacCatalyst. |
| src/libraries/System.Net.Sockets/tests/FunctionalTests/NetworkStreamTest.cs | Adds an override to supply MemberType for MemberData on a conformance theory. |
| src/libraries/System.Linq.Expressions/tests/DebuggerTypeProxy/ExpressionDebuggerTypeProxyTests.cs | Gates a reflection-heavy theory away from NativeAOT via ConditionalTheory. |
| src/libraries/Microsoft.Extensions.Hosting/tests/UnitTests/Internal/HostTests.cs | Further gates Moq/RefEmit-based tests away from aggressively-trimmed/AOT-like environments. |
Copilot's findings
- Files reviewed: 6/6 changed files
- Comments generated: 1
|
/azp run runtime-extra-platforms |
|
Azure Pipelines successfully started running 1 pipeline(s). |
943dd48 to
89a6b9b
Compare
…CoreCLR
On maccatalyst-arm64 AllSubsets_CoreCLR (runtime-extra-platforms), ILLink strips
the inherited ConnectedStreamConformanceTests.ReadWrite_Success_MemberData and
CopyToAsync_AllDataCopied_MemberData statics, so xUnit's [MemberData] discovery
throws ArgumentException ("Could not find public static member ...") before the
test body runs, on CryptoStreamTests.ReadWrite_Success and
NetworkStreamTest.CopyToAsync_AllDataCopied.
Override each test to add a [DynamicDependency] root keeping the base statics
alive under trimming. xUnit does not inherit attributes from overridden virtual
methods, so the overrides also restate the base gating: the
IsMultithreadingSupported ConditionalTheory (System.Net.Sockets.Tests runs on
single-threaded wasi in CI) and the LinuxBionic and iOS/tvOS platform skips.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
89a6b9b to
cb1a6be
Compare
CryptoStreamTests wraps in-memory ConnectedStreams.CreateBidirectional(), not sockets, so the LinuxBionic/iOS/tvOS skips (reasoned as UNIX-socket restrictions) do not apply. The sibling ReadWrite_Success_Large override in the same class carries no such skips. The override keeps [Theory], qualified [MemberData], and [DynamicDependency] to root the inherited static MemberData against the trimmer on maccatalyst CoreCLR. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
NetworkStreamTest binds TCP loopback sockets; the restriction is the CI sandbox blocking socket binding, not UNIX sockets specifically. Collapse the LinuxBionic and iOS/tvOS skips into a single SkipOnPlatform with a clearer reason. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
No pipelines are associated with this pull request. |
|
/azp list |
This comment was marked as off-topic.
This comment was marked as off-topic.
|
/azp run runtime-extra-platforms |
|
Azure Pipelines successfully started running 1 pipeline(s). |
| @@ -35,6 +36,11 @@ protected override Task<StreamPair> CreateWrappedConnectedStreamsAsync(StreamPai | |||
| [MemberData(nameof(ReadWrite_Success_Large_MemberData))] | |||
| public override Task ReadWrite_Success_Large(ReadWriteMode mode, int writeSize, bool startWithFlush) => base.ReadWrite_Success_Large(mode, writeSize, startWithFlush); | |||
|
|
|||
| [Theory] | |||
| [MemberData(nameof(ConnectedStreamConformanceTests.ReadWrite_Success_MemberData), MemberType = typeof(ConnectedStreamConformanceTests))] | |||
There was a problem hiding this comment.
This looks weird. It is very common to have MemberData in the test suite and it doesn't seem like we need to special case this everywhere else. I suspect the test assembly is rooted so the linker doesn't trim test code. In this case I suspect the assembly containing ConnectedStreamConformanceTests.ReadWrite_Success_MemberData, aka StreamConformanceTests is not rooted for whatever reason.
Looking a bit deeper, this assembly is specially rooted for a bunch of test suites using it ex: https://github.com/dotnet/runtime/blob/main/src/libraries/System.Runtime/tests/System.IO.FileSystem.Tests/ILLink.Descriptors.xml. I believe we should do the same here
Description
On maccatalyst-arm64
AllSubsets_CoreCLR, ILLink strips the inheritedReadWrite_Success_MemberDataandCopyToAsync_AllDataCopied_MemberDatastatics onConnectedStreamConformanceTests, so xUnit's[MemberData]lookup fails forCryptoStreamTests.ReadWrite_SuccessandNetworkStreamTest.CopyToAsync_AllDataCopied. Adds a[DynamicDependency]on each derived override to root the base statics, and restores theIsMultithreadingSupportedguard onCopyToAsync_AllDataCopied.