dotnet / runtime

.NET is a cross-platform runtime for cloud, mobile, desktop, and IoT apps.
https://docs.microsoft.com/dotnet/core/
MIT License
15.45k stars 4.76k forks source link

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

Open stephentoub opened 5 months ago

stephentoub commented 5 months ago

Trying these instructions: https://github.com/dotnet/runtime/blob/fcdb6dba4c1d904d9ebe35f66fbfed8befa19755/src/libraries/System.Resources.Extensions/tests/System.Resources.Extensions.Tests.csproj#L34-L55

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
stephentoub commented 5 months ago

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

dotnet-policy-service[bot] commented 5 months ago

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

bartonjs commented 4 months ago

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 commented 4 months ago

Assigning to @adamsitnik; PTAL

steveharter commented 4 months ago

@adamsitnik do you plan on addressing this for v9?

adamsitnik commented 3 months ago

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

am11 commented 3 months ago

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