dotnet / runtime

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

Test failure: System.DirectoryServices.ActiveDirectory.Tests.ForestTests/GetForest_NonNullNameAndNotRootedDomain_NonUap(type: DirectoryServer, name: \"server:port\") #28925

Open ghost opened 5 years ago

ghost commented 5 years ago

Opened on behalf of @AriNuer

The test System.DirectoryServices.ActiveDirectory.Tests.ForestTests/GetForest_NonNullNameAndNotRootedDomain_NonUap(type: DirectoryServer, name: \"server:port\") has failed.

Failure Message:

We got unrecognized exception System.UnauthorizedAccessException: Access is denied. ---> System.Runtime.InteropServices.COMException: Access is denied.\r
   at System.DirectoryServices.DirectoryEntry.Bind(Boolean throwIfFail) in F:\\vsagent\\5\\s\\src\\System.DirectoryServices\\src\\System\\DirectoryServices\\DirectoryEntry.cs:line 556\r
   at System.DirectoryServices.ActiveDirectory.DirectoryContext.IsContextValid(DirectoryContext context, DirectoryContextType contextType) in F:\\vsagent\\5\\s\\src\\System.DirectoryServices\\src\\System\\DirectoryServices\\ActiveDirectory\\DirectoryContext.cs:line 355\r
   --- End of inner exception stack trace ---\r
   at System.DirectoryServices.ActiveDirectory.DirectoryContext.IsContextValid(DirectoryContext context, DirectoryContextType contextType) in F:\\vsagent\\5\\s\\src\\System.DirectoryServices\\src\\System\\DirectoryServices\\ActiveDirectory\\DirectoryContext.cs:line 367\r
   at System.DirectoryServices.ActiveDirectory.DirectoryContext.isServer() in F:\\vsagent\\5\\s\\src\\System.DirectoryServices\\src\\System\\DirectoryServices\\ActiveDirectory\\DirectoryContext.cs:line 430\r
   at System.DirectoryServices.ActiveDirectory.Forest.GetForest(DirectoryContext context) in F:\\vsagent\\5\\s\\src\\System.DirectoryServices\\src\\System\\DirectoryServices\\ActiveDirectory\\Forest.cs:line 112\r
   at System.DirectoryServices.ActiveDirectory.Tests.ForestTests.<>c__DisplayClass4_0.<GetForest_NonNullNameAndNotRootedDomain_NonUap>b__0() in F:\\vsagent\\5\\s\\src\\System.DirectoryServices\\tests\\System\\DirectoryServices\\ActiveDirectory\\ForestTests.cs:line 62\r
   at Xunit.Record.Exception(Func`1 testCode) in C:\\projects\\xunit\\src\\xunit.core\\Record.cs:line 47\r
Expected: True\r
Actual:   False

Stack Trace:

   at System.DirectoryServices.ActiveDirectory.Tests.ForestTests.GetForest_NonNullNameAndNotRootedDomain_NonUap(DirectoryContextType type, String name) in F:\vsagent\5\s\src\System.DirectoryServices\tests\System\DirectoryServices\ActiveDirectory\ForestTests.cs:line 64

Build : 3.0 - 20190310.9 (Core Tests) Failing configurations:

Details: https://mc.dot.net/#/product/netcore/30/source/official~2Fdotnet~2Fcorefx~2Frefs~2Fheads~2Fmaster/type/test~2Ffunctional~2Fcli~2F/build/20190310.9/workItem/System.DirectoryServices.Tests/analysis/xunit/System.DirectoryServices.ActiveDirectory.Tests.ForestTests~2FGetForest_NonNullNameAndNotRootedDomain_NonUap(type:%20DirectoryServer,%20name:%20%5C%22server:port%5C%22)

wtgodbe commented 5 years ago

Same issue as https://github.com/dotnet/corefx/issues/37082

karelz commented 5 years ago

@tquerec can you please take a look at this one? It has multiple dupes and multiple occurrences. It is important for arm64 IoT. Let me know if you have further questions about priority, importance or how to debug these things. Thanks!

wtgodbe commented 5 years ago

Copied from the other issue:

This issue isn't with Process, but with System.DirectoryServices, and only on Arm64. We see the same failure in FindByTransportType_ForestNoDomainAssociatedWithName_ThrowsActiveDirectoryOperationException_NoUap and GetForest_NonNullNameAndNotRootedDomain_NonUap(type: Forest, name: \"\0\".

The first is in a call to ActiveDirectoryInterSiteTransport.FindByTransportType: https://github.com/dotnet/corefx/blob/374833115e24d6384da62fa631acde2e65101eb8/src/System.DirectoryServices/tests/System/DirectoryServices/ActiveDirectory/ActiveDirectoryInterSiteTransportTests.cs#L55

The second is in a call to Forest.GetForest() : https://github.com/dotnet/corefx/blob/374833115e24d6384da62fa631acde2e65101eb8/src/System.DirectoryServices/tests/System/DirectoryServices/ActiveDirectory/ForestTests.cs#L62.

All three instances of this (that I've seen) are hitting the exception in PropertyManager.GetPropertyValue(): https://github.com/dotnet/corefx/blob/374833115e24d6384da62fa631acde2e65101eb8/src/System.DirectoryServices/src/System/DirectoryServices/ActiveDirectory/PropertyManager.cs#L133-L159

It just so happens that this test in System.Diagnostics.Process is the only place in the repo where we call GetComputerDomain(). Moving this to DirectoryServices.