Remove duplicate [Theory] and [MemberData] from ROSequenceStreamConformanceTests.Seek_PastEnd_ReadReturns0#129979
Remove duplicate [Theory] and [MemberData] from ROSequenceStreamConformanceTests.Seek_PastEnd_ReadReturns0#129979Copilot wants to merge 5 commits into
Conversation
…rmanceTests.Seek_PastEnd_ReadReturns0 Co-authored-by: adamsitnik <6011991+adamsitnik@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
This PR cleans up the System.Memory ReadOnlySequenceStream conformance test override by removing redundant xUnit attributes so that the test continues to use the base class’ data source and theory definition.
Changes:
- Removed
[Theory]and[MemberData(nameof(AllSeekModes))]fromROSequenceStreamConformanceTests.Seek_PastEnd_ReadReturns0. - Ensures the override relies on the base
StreamConformanceTests.Seek_PastEnd_ReadReturns0attributes (whereAllSeekModesis declared), avoidingMemberDatareflection on derived test types.
|
/azp list |
|
/azp run runtime-extra-platforms |
|
Azure Pipelines successfully started running 1 pipeline(s). |
adamsitnik
left a comment
There was a problem hiding this comment.
@copilot on tvOS, where trimming is enabled, the tests are still failing:
[14:41:33] dbug: [14:18:27.3976820] Test collection for System.Memory.Tests.NativeReadOnlyMemoryStreamConformanceTests
[14:41:33] dbug: [14:18:27.4255060] 2026-06-29 11:18:27.532 System.Memory.Tests[10718:8359778] [FAIL] System.Memory.Tests.NativeReadOnlyMemoryStreamConformanceTests.Seek_PastEnd_ReadReturns0
[14:41:33] dbug: [14:18:27.4255500] 2026-06-29 11:18:27.532 System.Memory.Tests[10718:8359778] System.ArgumentException : Could not find public static member (property, field, or method) named 'AllSeekModes' on System.Memory.Tests.NativeReadOnlyMemoryStreamConformanceTests
Figure out the best way to solve it
The idea was to match the default release behavior on mobile. I'm open to switching to partial trimming if it won't regress test coverage and still reflects user scenarios |
Co-authored-by: kotlarmilos <11523312+kotlarmilos@users.noreply.github.com>
Implemented in 6c772a5. I removed the class-local |
|
/azp run runtime-extra-platforms |
|
Azure Pipelines successfully started running 1 pipeline(s). |
adamsitnik
left a comment
There was a problem hiding this comment.
@copilot fix following build failure:
D:\a\_work\1\s\eng\testing\ILLink.Descriptor.StreamConformanceTests.xml(2,4): error IL2007: Could not resolve assembly 'StreamConformanceTests'. [D:\a\_work\1\s\src\libraries\System.Runtime\tests\System.Runtime.Tests\System.Runtime.Tests.csproj::TargetFramework=net11.0-browser]
D:\a\_work\1\s\src\tools\illink\src\ILLink.Tasks\build\Microsoft.NET.ILLink.targets(108,5): error NETSDK1144: Optimizing assemblies for size failed. [D:\a\_work\1\s\src\libraries\System.Runtime\tests\System.Runtime.Tests\System.Runtime.Tests.csproj::TargetFramework=net11.0-browser]
Co-authored-by: adamsitnik <6011991+adamsitnik@users.noreply.github.com>
Fixed in 60b9a16. I scoped This keeps the tvOS/iOS trimming fix and prevents browser aggressive-trimming legs (e.g., |
|
/azp run runtime-extra-platforms |
|
Azure Pipelines successfully started running 1 pipeline(s). |
adamsitnik
left a comment
There was a problem hiding this comment.
@copilot the tvOS build fails (log):
/Users/runner/work/1/s/eng/testing/ILLink.Descriptor.StreamConformanceTests.xml(2,4): error IL2007: Could not resolve assembly 'StreamConformanceTests'. [/Users/runner/work/1/s/src/libraries/System.Runtime/tests/System.Runtime.Tests/System.Runtime.Tests.csproj::TargetFramework=net11.0-unix]
/Users/runner/work/1/s/src/tools/illink/src/ILLink.Tasks/build/Microsoft.NET.ILLink.targets(108,5): error NETSDK1144: Optimizing assemblies for size failed. [/Users/runner/work/1/s/src/libraries/System.Runtime/tests/System.Runtime.Tests/System.Runtime.Tests.csproj::TargetFramework=net11.0-unix]
fix it..
…h references Co-authored-by: adamsitnik <6011991+adamsitnik@users.noreply.github.com>
Fixed in I changed This prevents Validated with:
|
The problem is that xUnit uses reflection based discovery so if we forget to root an assembly with tests, the tests simply won't run. We were lucky here the But the class that defines We were trimming those and they just silently didn't run. If it wasn't for the MemberData reference, we would never find out we're not running these on mobile. I do not think TrimMode=partial vs TrimMode=full matters here in practice. TrimMode=partial is still going to perform TrimMode=full behavior on all the framework assemblies because they're marked IsTrimmable. It will not trim test assemblies (we don't want that anyway). It will not trim xUnit implementation assemblies (we don't want that either - I see mobile testing roots them explicitly too). And I don't know what else is left that we want to trim to be "real world". |

The
Seek_PastEnd_ReadReturns0override inROSequenceStreamConformanceTestsredundantly declared[Theory]and[MemberData(nameof(AllSeekModes))]— these are inherited from the base virtual method inStandaloneStreamConformanceTestsand don't need to be repeated.All 52,894 System.Memory tests pass;
Seek_PastEnd_ReadReturns0confirmed running across all 3 conformance test classes (20 results).fixes #129922