-
Notifications
You must be signed in to change notification settings - Fork 5.3k
Closed
Labels
arch-arm64area-Interop-coreclrdisabled-testThe test is disabled in source code against the issueThe test is disabled in source code against the issueos-windows
Milestone
Description
Failed on rolling build: https://dev.azure.com/dnceng/public/_build/results?buildId=1442365&view=results
DllImportGenerator.UnitTests.ConvertToGeneratedDllImportAnalyzerTests.TypeRequiresMarshalling_ReportsDiagnostic(type: typeof(System.ConsoleKeyInfo)) [FAIL]
Microsoft.CodeAnalysis.Testing.Verifiers.EqualWithMessageException : Context: Diagnostics of test state
Mismatch between number of diagnostics returned, expected "2" actual "1"
Diagnostics:
// error AD0001: Analyzer 'Microsoft.Interop.Analyzers.ConvertToGeneratedDllImportAnalyzer' threw an exception of type 'System.NullReferenceException' with message 'Object reference not set to an instance of an object.'.
Exception occurred with following context:
Compilation: TestProject
System.NullReferenceException: Object reference not set to an instance of an object.
at Microsoft.CodeAnalysis.MetadataHelpers.GetInfoForImmediateNamespaceMembers(Boolean isGlobalNamespace, Int32 namespaceNameLength, IEnumerable`1 typesByNS, StringComparer nameComparer, IEnumerable`1& types, IEnumerable`1& namespaces)
at Microsoft.CodeAnalysis.CSharp.Symbols.Metadata.PE.PENamespaceSymbol.LoadAllMembers(IEnumerable`1 typesByNS)
at Microsoft.CodeAnalysis.CSharp.Symbols.Metadata.PE.PENestedNamespaceSymbol.EnsureAllMembersLoaded()
at Microsoft.CodeAnalysis.CSharp.Symbols.Metadata.PE.PENamespaceSymbol.GetMembers(String name)
at Microsoft.CodeAnalysis.CSharp.Symbols.NamespaceSymbol.LookupNestedNamespace(ImmutableArray`1 names)
at Microsoft.CodeAnalysis.CSharp.Symbols.NonMissingModuleSymbol.LookupTopLevelMetadataType(MetadataTypeName& emittedName)
at Microsoft.CodeAnalysis.CSharp.Symbols.NonMissingAssemblySymbol.LookupTopLevelMetadataTypeWithCycleDetection(MetadataTypeName& emittedName, ConsList`1 visitedAssemblies, Boolean digThroughForwardedTypes)
at Microsoft.CodeAnalysis.CSharp.Symbols.AssemblySymbol.LookupTopLevelMetadataType(MetadataTypeName& emittedName, Boolean digThroughForwardedTypes)
at Microsoft.CodeAnalysis.CSharp.Symbols.AssemblySymbol.GetTopLevelTypeByMetadataName(AssemblySymbol assembly, MetadataTypeName& metadataName, AssemblyIdentity assemblyOpt)
at Microsoft.CodeAnalysis.CSharp.Symbols.AssemblySymbol.GetTopLevelTypeByMetadataName(MetadataTypeName& metadataName, AssemblyIdentity assemblyOpt, Boolean includeReferences, Boolean isWellKnownType, ValueTuple`2& conflicts, DiagnosticBag warnings, Boolean ignoreCorLibraryDuplicatedTypes)
at Microsoft.CodeAnalysis.CSharp.Symbols.AssemblySymbol.GetTypeByMetadataName(String metadataName, Boolean includeReferences, Boolean isWellKnownType, ValueTuple`2& conflicts, Boolean useCLSCompliantNameArityEncoding, DiagnosticBag warnings, Boolean ignoreCorLibraryDuplicatedTypes)
at Microsoft.CodeAnalysis.CSharp.CSharpCompilation.GetTypeByMetadataName(String fullyQualifiedMetadataName)
at Microsoft.CodeAnalysis.CSharp.CSharpCompilation.CommonGetTypeByMetadataName(String metadataName)
at Microsoft.Interop.Analyzers.ConvertToGeneratedDllImportAnalyzer.<>c.<Initialize>b__5_0(CompilationStartAnalysisContext compilationContext) in /_/src/libraries/System.Runtime.InteropServices/gen/DllImportGenerator/Analyzers/ConvertToGeneratedDllImportAnalyzer.cs:line 0
at Microsoft.CodeAnalysis.Diagnostics.AnalyzerExecutor.<>c.<ExecuteCompilationStartActions>b__44_0(ValueTuple`2 data)
at Microsoft.CodeAnalysis.Diagnostics.AnalyzerExecutor.ExecuteAndCatchIfThrows_NoLock[TArg](DiagnosticAnalyzer analyzer, Action`1 analyze, TArg argument, Nullable`1 info)
-----
Suppress the following diagnostics to disable this analyzer: DLLIMPORTGENANALYZER015
DiagnosticResult.CompilerError("AD0001").WithArguments("Microsoft.Interop.Analyzers.ConvertToGeneratedDllImportAnalyzer", "System.NullReferenceException", "Object reference not set to an instance of an object.", "Exception occurred with following context:
Compilation: TestProject
System.NullReferenceException: Object reference not set to an instance of an object.
at Microsoft.CodeAnalysis.MetadataHelpers.GetInfoForImmediateNamespaceMembers(Boolean isGlobalNamespace, Int32 namespaceNameLength, IEnumerable`1 typesByNS, StringComparer nameComparer, IEnumerable`1& types, IEnumerable`1& namespaces)
at Microsoft.CodeAnalysis.CSharp.Symbols.Metadata.PE.PENamespaceSymbol.LoadAllMembers(IEnumerable`1 typesByNS)
at Microsoft.CodeAnalysis.CSharp.Symbols.Metadata.PE.PENestedNamespaceSymbol.EnsureAllMembersLoaded()
at Microsoft.CodeAnalysis.CSharp.Symbols.Metadata.PE.PENamespaceSymbol.GetMembers(String name)
at Microsoft.CodeAnalysis.CSharp.Symbols.NamespaceSymbol.LookupNestedNamespace(ImmutableArray`1 names)
at Microsoft.CodeAnalysis.CSharp.Symbols.NonMissingModuleSymbol.LookupTopLevelMetadataType(MetadataTypeName& emittedName)
at Microsoft.CodeAnalysis.CSharp.Symbols.NonMissingAssemblySymbol.LookupTopLevelMetadataTypeWithCycleDetection(MetadataTypeName& emittedName, ConsList`1 visitedAssemblies, Boolean digThroughForwardedTypes)
at Microsoft.CodeAnalysis.CSharp.Symbols.AssemblySymbol.LookupTopLevelMetadataType(MetadataTypeName& emittedName, Boolean digThroughForwardedTypes)
at Microsoft.CodeAnalysis.CSharp.Symbols.AssemblySymbol.GetTopLevelTypeByMetadataName(AssemblySymbol assembly, MetadataTypeName& metadataName, AssemblyIdentity assemblyOpt)
at Microsoft.CodeAnalysis.CSharp.Symbols.AssemblySymbol.GetTopLevelTypeByMetadataName(MetadataTypeName& metadataName, AssemblyIdentity assemblyOpt, Boolean includeReferences, Boolean isWellKnownType, ValueTuple`2& conflicts, DiagnosticBag warnings, Boolean ignoreCorLibraryDuplicatedTypes)
at Microsoft.CodeAnalysis.CSharp.Symbols.AssemblySymbol.GetTypeByMetadataName(String metadataName, Boolean includeReferences, Boolean isWellKnownType, ValueTuple`2& conflicts, Boolean useCLSCompliantNameArityEncoding, DiagnosticBag warnings, Boolean ignoreCorLibraryDuplicatedTypes)
at Microsoft.CodeAnalysis.CSharp.CSharpCompilation.GetTypeByMetadataName(String fullyQualifiedMetadataName)
at Microsoft.CodeAnalysis.CSharp.CSharpCompilation.CommonGetTypeByMetadataName(String metadataName)
at Microsoft.Interop.Analyzers.ConvertToGeneratedDllImportAnalyzer.<>c.<Initialize>b__5_0(CompilationStartAnalysisContext compilationContext) in /_/src/libraries/System.Runtime.InteropServices/gen/DllImportGenerator/Analyzers/ConvertToGeneratedDllImportAnalyzer.cs:line 0
at Microsoft.CodeAnalysis.Diagnostics.AnalyzerExecutor.<>c.<ExecuteCompilationStartActions>b__44_0(ValueTuple`2 data)
at Microsoft.CodeAnalysis.Diagnostics.AnalyzerExecutor.ExecuteAndCatchIfThrows_NoLock[TArg](DiagnosticAnalyzer analyzer, Action`1 analyze, TArg argument, Nullable`1 info)
-----
Suppress the following diagnostics to disable this analyzer: DLLIMPORTGENANALYZER015"),
Assert.Equal() Failure
Expected: 2
Actual: 1
Stack Trace:
/_/src/Microsoft.CodeAnalysis.Testing/Microsoft.CodeAnalysis.Testing.Verifiers.XUnit/XUnitVerifier.cs(49,0): at Microsoft.CodeAnalysis.Testing.Verifiers.XUnitVerifier.Equal[T](T expected, T actual, String message)
/_/src/Microsoft.CodeAnalysis.Testing/Microsoft.CodeAnalysis.Analyzer.Testing/AnalyzerTest`1.cs(359,0): at Microsoft.CodeAnalysis.Testing.AnalyzerTest`1.VerifyDiagnosticResults(IEnumerable`1 actualResults, ImmutableArray`1 analyzers, DiagnosticResult[] expectedResults, IVerifier verifier)
/_/src/Microsoft.CodeAnalysis.Testing/Microsoft.CodeAnalysis.Analyzer.Testing/AnalyzerTest`1.cs(272,0): at Microsoft.CodeAnalysis.Testing.AnalyzerTest`1.VerifyDiagnosticsAsync(EvaluatedProjectState primaryProject, ImmutableArray`1 additionalProjects, DiagnosticResult[] expected, IVerifier verifier, CancellationToken cancellationToken)
/_/src/Microsoft.CodeAnalysis.Testing/Microsoft.CodeAnalysis.CodeFix.Testing/CodeFixTest`1.cs(264,0): at Microsoft.CodeAnalysis.Testing.CodeFixTest`1.RunImplAsync(CancellationToken cancellationToken)
/_/src/libraries/System.Runtime.InteropServices/tests/DllImportGenerator.UnitTests/Verifiers/CSharpCodeFixVerifier.cs(124,0): at DllImportGenerator.UnitTests.Verifiers.CSharpCodeFixVerifier`2.Test.RunImplAsync(CancellationToken cancellationToken)
/_/src/Microsoft.CodeAnalysis.Testing/Microsoft.CodeAnalysis.Analyzer.Testing/AnalyzerTest`1.cs(180,0): at Microsoft.CodeAnalysis.Testing.AnalyzerTest`1.RunAsync(CancellationToken cancellationToken)
/_/src/libraries/System.Runtime.InteropServices/tests/DllImportGenerator.UnitTests/Verifiers/CSharpAnalyzerVerifier.cs(37,0): at DllImportGenerator.UnitTests.Verifiers.CSharpAnalyzerVerifier`1.VerifyAnalyzerAsync(String source, DiagnosticResult[] expected)
/_/src/libraries/System.Runtime.InteropServices/tests/DllImportGenerator.UnitTests/ConvertToGeneratedDllImportAnalyzerTests.cs(53,0): at DllImportGenerator.UnitTests.ConvertToGeneratedDllImportAnalyzerTests.TypeRequiresMarshalling_ReportsDiagnostic(Type type)
--- End of stack trace from previous location ---
cc: @jkoritzinsky
Metadata
Metadata
Assignees
Labels
arch-arm64area-Interop-coreclrdisabled-testThe test is disabled in source code against the issueThe test is disabled in source code against the issueos-windows