Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

System.Resources.Extensions.Tests resource re-generation is broken after BinaryFormatter extrication #104216

Open
stephentoub opened this issue Jul 1, 2024 · 7 comments
Labels
area-System.Resources binaryformatter-migration Issues related to the removal of BinaryFormatter and migrations away from it blocking-outerloop Blocking the 'runtime-coreclr outerloop' and 'runtime-libraries-coreclr outerloop' runs test-bug Problem in test source code (most likely)
Milestone

Comments

@stephentoub
Copy link
Member

Trying these instructions:

<!-- Use the following target to regenerate the test resources file.
This is done from a test application and checked in so that we don't run
product code during the build.
Important:
When invoking this target, pass the target framework in as well, substituting
the X with the current major version:
dotnet build -f netX.0-windows && cd outputdir && dotnet build -f netX.0-windows /t:GenerateTestResourcesFile. -->
<Target Name="GenerateTestResourcesFile">
<PropertyGroup>
<_executor>Microsoft.DotNet.RemoteExecutor.dll</_executor>
</PropertyGroup>
<ItemGroup>
<ExecuteMethod Class="System.Resources.Extensions.Tests.TestData" Include="WriteResources" Parameters="$(MSBuildProjectDirectory)\TestData.resources" />
<ExecuteMethod>
<ExceptionFile>$(TargetDir)%(Class)%(Identity).exception.txt</ExceptionFile>
</ExecuteMethod>
<ExecuteMethod>
<Command>$(NetCoreAppCurrentTestHostPath)dotnet exec --runtimeconfig $(TargetDir)$(TargetName).runtimeconfig.json $(_executor) $(AssemblyName) %(Class) %(Identity) %(ExceptionFile) %(Parameters)</Command>
</ExecuteMethod>
</ItemGroup>
<Exec Command="%(ExecuteMethod.Command)" WorkingDirectory="$(TargetDir)" />
</Target>

Results in:

  Unhandled exception. System.IO.FileNotFoundException: Could not load file or assembly 'System.Runtime.Serialization.Formatters, Version=9.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. The system cannot find the file specified.
  File name: 'System.Runtime.Serialization.Formatters, Version=9.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'
     at System.Resources.Extensions.Tests.TestData.WriteResourcesStream(Stream stream)
     at System.Resources.Extensions.Tests.TestData.WriteResources(String file) in D:\repos\runtime\src\libraries\System.Resources.Extensions\tests\TestData.cs:line 228
     at System.RuntimeMethodHandle.InvokeMethod(Object target, Void** arguments, Signature sig, Boolean isConstructor)
     at System.Reflection.MethodBaseInvoker.InterpretedInvoke_Method(Object obj, IntPtr* args) in D:\repos\runtime\src\coreclr\System.Private.CoreLib\src\System\Reflection\MethodBaseInvoker.CoreCLR.cs:line 36
     at System.Reflection.MethodBaseInvoker.InvokeDirectByRefWithFewArgs(Object obj, Span`1 copyOfArgs, BindingFlags invokeAttr) in D:\repos\runtime\src\libraries\System.Private.CoreLib\src\System\Reflection\MethodBaseInvoker.cs:line 178
  --- End of stack trace from previous location ---
     at Microsoft.DotNet.RemoteExecutor.Program.Main(String[] args) in /_/src/Microsoft.DotNet.RemoteExecutor/src/Program.cs:line 97
@dotnet-issue-labeler dotnet-issue-labeler bot added the needs-area-label An area label is needed to ensure this gets routed to the appropriate area owners label Jul 1, 2024
@dotnet-policy-service dotnet-policy-service bot added the untriaged New issue has not been triaged by the area owner label Jul 1, 2024
@stephentoub
Copy link
Member Author

cc: @bartonjs, @adamsitnik, am I just holding it wrong or do the instructions need to be redone?

@jkotas jkotas added binaryformatter-migration Issues related to the removal of BinaryFormatter and migrations away from it area-System.Resources labels Jul 1, 2024
Copy link
Contributor

Tagging subscribers to this area: @dotnet/area-system-resources
See info in area-owners.md if you want to be subscribed.

@vcsjones vcsjones removed the needs-area-label An area label is needed to ensure this gets routed to the appropriate area owners label Jul 1, 2024
@bartonjs
Copy link
Member

bartonjs commented Jul 1, 2024

That looks like some piece is missing the package reference to the new nuget package, since it's complaining it can't find the 9.0.0 version of the assembly.

@steveharter
Copy link
Member

Assigning to @adamsitnik; PTAL

@steveharter steveharter added this to the 9.0.0 milestone Jul 3, 2024
@steveharter steveharter added bug and removed untriaged New issue has not been triaged by the area owner labels Jul 3, 2024
@steveharter steveharter added test-bug Problem in test source code (most likely) and removed bug labels Jul 3, 2024
@steveharter
Copy link
Member

@adamsitnik do you plan on addressing this for v9?

@adamsitnik
Copy link
Member

I am sorry, but I have no idea how to fix it. @bartonjs is most likely the best person to look at it.

I am going to move it to 10.0 as it does not seem to be mandatory to ship

@adamsitnik adamsitnik removed their assignment Jul 31, 2024
@adamsitnik adamsitnik modified the milestones: 9.0.0, 10.0.0 Jul 31, 2024
@am11 am11 added the blocking-outerloop Blocking the 'runtime-coreclr outerloop' and 'runtime-libraries-coreclr outerloop' runs label Aug 24, 2024
@am11
Copy link
Member

am11 commented Aug 24, 2024

All these failures in runtime-coreclr crossgen2 pipeline are giving the same stack trace:

image
----- start Sat 08/24/2024 17:54:34.99 ===============  To repro directly: =====================================================
pushd C:\h\w\AD33092B\w\9A4808EF\e\
System.Resources.Extensions.BinaryFormat.Tests.exe -notrait category=IgnoreForCI -notrait category=OuterLoop -notrait category=failing -xml testResults.xml 
popd
===========================================================================================================

C:\h\w\AD33092B\w\9A4808EF\e>System.Resources.Extensions.BinaryFormat.Tests.exe -notrait category=IgnoreForCI -notrait category=OuterLoop -notrait category=failing -xml testResults.xml  
Running assembly:System.Resources.Extensions.BinaryFormat.Tests, Version=9.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51
Unhandled exception. System.IO.FileNotFoundException: Could not load file or assembly 'System.Runtime.Serialization.Formatters, Version=9.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. The system cannot find the file specified.
File name: 'System.Runtime.Serialization.Formatters, Version=9.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'
   at System.Reflection.RuntimeAssembly.GetExportedTypes()
   at Xunit.Sdk.ReflectionAssemblyInfo.GetTypes(Boolean includePrivateTypes) in /_/src/xunit.execution/Sdk/Reflection/ReflectionAssemblyInfo.cs:line 80
   at Xunit.Sdk.TestCollectionFactoryHelper.GetTestCollectionDefinitions(IAssemblyInfo assemblyInfo, IMessageSink diagnosticMessageSink) in /_/src/xunit.execution/Sdk/Frameworks/TestCollectionFactoryHelper.cs:line 22
   at Xunit.Sdk.CollectionPerClassTestCollectionFactory..ctor(ITestAssembly testAssembly, IMessageSink diagnosticMessageSink) in /_/src/xunit.execution/Sdk/Frameworks/CollectionPerClassTestCollectionFactory.cs:line 27
   at Xunit.Sdk.ExtensibilityPointFactory.GetXunitTestCollectionFactory(IMessageSink diagnosticMessageSink, IAttributeInfo collectionBehaviorAttribute, ITestAssembly testAssembly) in /_/src/xunit.execution/Sdk/ExtensibilityPointFactory.cs:line 245
   at Xunit.Sdk.XunitTestFrameworkDiscoverer..ctor(IAssemblyInfo assemblyInfo, ISourceInformationProvider sourceProvider, IMessageSink diagnosticMessageSink, IXunitTestCollectionFactory collectionFactory) in /_/src/xunit.execution/Sdk/Frameworks/XunitTestFrameworkDiscoverer.cs:line 45
   at Xunit.Sdk.XunitTestFramework.CreateDiscoverer(IAssemblyInfo assemblyInfo) in /_/src/xunit.execution/Sdk/Frameworks/XunitTestFramework.cs:line 21
   at SingleFileTestRunner.Main(String[] args) in /_/src/libraries/Common/tests/SingleFileTestRunner/SingleFileTestRunner.cs:line 75
----- end Sat 08/24/2024 17:54:40.24 ----- exit code -532462766 ----------------------------------------------------------
----- start ===============  XUnitLogChecker Output =====================================================
C:\h\w\AD33092B\p\dotnet.exe --roll-forward Major C:\h\w\AD33092B\p\XUnitLogChecker.dll --dumps-path C:\cores
[XUnitLogChecker]: 17:54:40.34: Only dumps checking will be done.

https://helixre107v0xdcypoyl9e7f.blob.core.windows.net/dotnet-runtime-refs-heads-main-1c0e383857b0417582/System.Resources.Extensions.BinaryFormat.Tests/1/console.500e9752.log?helixlogtype=result

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-System.Resources binaryformatter-migration Issues related to the removal of BinaryFormatter and migrations away from it blocking-outerloop Blocking the 'runtime-coreclr outerloop' and 'runtime-libraries-coreclr outerloop' runs test-bug Problem in test source code (most likely)
Projects
None yet
Development

No branches or pull requests

7 participants