-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
xUnit is crashing due a NET's EventListener race #6358
Comments
This change disables AppDomain isolation in the unit tests that don't require it. This is necessary for our goal of running many of the suites on CoreCLR and helps reduce our exposure to dotnet#6358. The AppDomain creation code incorrectly used AppDomain.CurrentDomain.BaseDirectory as the new base directory. There is no gurantee this points to the directory containing the unit test binaries and this is actually the case in xunit without AppDomains. Instead it points to the directory containing xunit.oconsole.x86 and uses AppDomain.ResolveAssembly / LoadFrom to resolve unit test binaries. Switching over to no AppDomains in xunit was causing the creation of RuntimeAssemblyManager across AppDomains to fail. The error given was a failure to load Roslyn.Test.Utilities.Desktop in the original AppDomain. This is odd given that the code is executing inside Roslyn.Test.Utilities.Desktop. The error was fixed by hooking AppDomain.AssemblyResolve in the original AppDomain and essentially reloading the DLL. I'm not completely sure why this worked but I suspect it has to do with the original AppDomain having an incorrect base directory.
To followup after some investigation into the xunit code base we determined there is no real work around they can do for this bug. xunit is just running into this issue through no fault of their own and there is little they can do to avoid hitting it. |
It's been about 1 month since we removed |
We're still running into this with the scripting tests. I've submitted a PR as a workaround, let's use this bug to track removing the workaround. |
@davkean i looked at the scripting tests and it looks like they are still using <add key="xunit.appDomain" value="required"/> This is why scripting is still seeing this issue. If this is switched to denied then the bug won't be a factor anymore because xunit won't be dealing with Do we have a bug changing scripting to no longer using |
This change disables AppDomain isolation in the unit tests that don't require it. This is necessary for our goal of running many of the suites on CoreCLR and helps reduce our exposure to dotnet#6358.
This will cause us to avoid hitting the EventListener bug: dotnet#6358.
Hit this issue recently Build #159 (Apr 13, 2016 2:26:01 AM) |
Closing this as this issue is resolved. |
This will cause us to avoid hitting the EventListener bug: dotnet/roslyn#6358.
Tests are often failing with:
This a .NET bug; dotnet/corefx#3793, however, we're not going to see a fix soon. I've got an ask out to xUnit to see if we can submit a PR to workaround the issue: xunit/xunit#646
If not, then we might need build our own version of xUnit and work around it manually. We're hitting this ~2 - 3 every 50 runs.
The text was updated successfully, but these errors were encountered: