-
Notifications
You must be signed in to change notification settings - Fork 323
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
The provided manager was not found in any slot. #4469
Comments
@jeromelaban Could you please tell me more about how you run your tests (e.g. dotnet test, vstest.console, vstest task, classical / yaml pipeline)? And what is in your solution, are you multi targetting? Are you running in parallel? |
I am experiencing the same problem, but I am not using Azure Devops, but I also switched to VS version 17.6.0, so it is related to new VS version |
@PeterHevesi do you have some more details on how to repro this please? |
Sorry, no I don't and I would explore it further to tell you, but I don't have time, I am very busy now, so I am rather downgrading to VS 17.5 |
Totally understandable. Thanks for getting back to me. |
Thanks for taking a look into this. This is our CI step, and we're using Here's a larger build log, if that can help. |
Okay, thanks, looks like it is in fact related to #4467 and a workaround for you would be to provide dll filter that is specific to your test project naming pattern. It seems that most your projects are named Tests..dll So I would try replacing this line, with https://github.com/unoplatform/uno/blob/master/build/ci/.azure-devops-unit-tests.yml#L77 |
@nohwnd , Hi, so now I have some more time, so I will tell you my setup: And so, are you working on fixing this? How it is going? When do you expect it to be fixed? |
@PeterHevesi I still have not been able to repro this, the related Fix that Amaury mentions might help to fix this. But until I came up with a repro I can't comment on what exactly is going on. Once we have a fix we will roll it out to nuget, and insert into dotnet sdk and VS, as we will be doing with 17.6.1 that has fix fir #4474 |
@jeromelaban looking at your build log (reposted below in case the build gets removed). There are several errors that prevent testhost from starting/running. The error I see two types of errors: Testhost process for source(s) 'D:\a\1\s\src\Build\Tests\bin\Release_AnyCPU\net7.0\Uno.Analyzers.Tests.dll' exited with error: Error: There is a dependency in manifest that is not found so the process cannot start. And Testhost process for source(s) 'D:\a\1\s\src\Uno.UI.Tests\bin\AnyCPU\Release\net7.0\Uno.UI.Tests.ViewLibrary.dll' exited with error: A fatal error was encountered. The library 'hostpolicy.dll' required to execute the application was not found in 'C:\hostedtoolcache\windows\dotnet'.
I can repro with running just in command line.
|
Additionally, did you move some of the projects from .NET Framework .NET? At least the one I was looking at is not referencing Microsoft.NET.Test.SDK, which will make it fallback on a fallback of test.sdk that is shipped with the console, and that might be imcompatible with the project, or broken in other ways because we are doing some assumptions there that might not be true. Edit: Adding that reference to the Uno.Analyzers.Tests project makes it run the tests in my console. |
@nohwnd Indeed, we moved some of the tests to .NET 7, in an upcoming branch (that's where the tests fail). The analyzer tests are not super fancy, though they depend on Roslyn, so maybe that's one of the source for the dependency issue? I'll add the reference and see if it helps on my end as well! Thanks for the troubleshooting! |
I've also finally found the underlying issue with not finding the manager in slot. private void StartTestRunOnConcurrentManager(
IProxyExecutionManager proxyExecutionManager,
IInternalTestRunEventsHandler eventHandler,
TestRunCriteria testRunCriteria,
bool initialized,
Task? initTask)
{
if (testRunCriteria != null)
{
Task.Run(() =>
{
if (!initialized)
{
if (!proxyExecutionManager.IsInitialized)
{
proxyExecutionManager.Initialize(_skipDefaultAdapters);
}
Interlocked.Increment(ref _runStartedClients);
proxyExecutionManager.InitializeTestRun(testRunCriteria, eventHandler);
}
else
{
initTask!.Wait();
}
EqtTrace.Verbose("ParallelProxyExecutionManager: Execution started. Started clients: " + _runStartedClients);
proxyExecutionManager.StartTestRun(testRunCriteria, eventHandler);
}) This code kicks off work on each testhost that we start in parallel (which we also use when we pre-start testhost).
The method returns void, and because it does not throw we dont't know that the initialization failed, and continue executing. We again attempt to start testhost, because On thing that threw me off was that the stacks look very similar in both places, so I did not notice that in one case we go directly into Initialize and in another we go into Start and then Initialize, even thought I was specifically thinking about that possibility, but did not compare the stacks in a diff tool unfortunately. That could have saved me half a day. If you ask why it worked in the past, that is because previously we did not use those slots and just ignored any double event notifications because the "testhost is dead anyway". In any case this is not a serious issue, as it can be reached only when the testhost already failed to start up. |
Thanks for the analysis! I can confirm that adding the missing package reference is fixing the issue. |
So what is the current state of this bug? |
@PeterHevesi I added a reference to |
@PeterHevesi 17.6.1 was released today with the fix for the other problem, which can under some circumstances fix this problem as well. This problem is only happening after crash of testhost (based on the provided repro), the testhost crash needs to be solved, as this is just a by-product of that crash. Why specifically it crashes in your case with 17.6.0 but not 17.5.0 I don't know, because I don't have a repro from you unfortunately. |
Test discovery and execution fails in Visual Studio, too (tested with 17.6.2 and 17.6.3).
|
The currently released version of VS 17.6.3 does not have the fix yet unfortunately, it will be in 17.6.4 that should ship in few days I hope. |
The behavior with 17.6.4 is exactly the same (on my Ryzen 5700U with 16 virtual cores). |
Yeah the error is still there in 17.6.4, altough from 17.6.3 I think, tests discovery works for me, so I can use it without any problem, it's just that I still see that error |
I just ran into this issue as well in 17.6.4. I always had the reference to Tests run fine with
|
We have the same problem too when using .NET6 but NOT when using .NET48
|
The worst thing is, that it ends with "Test discovery aborted" instead of continuing with the other .dlls or other assemblies i.e. you have randomly missing tests even though maybe only one .dll has an issue |
A (Re-) |
In Visual Studio Log/Output Window you can switch to the "Tests" Tab. You can see that it is always running the test discovery when you build a project. It even does the test discovery for all projects, not only the one that you build. So, triggering the test-discovery can be simply done by building (even if the build does nothing because all is build and just finishes right away) That also means that we are now spammed with these errors and exceptions (mentioned above) in the background on each build... |
This started happening in one of our solutions. I was at 17.6.4. |
I had to downgrade to 17.5.4 to get rid of the issue. |
Is this issue still going to be present in 17.7? |
@rjbye - Thanks; I just tried this and still have the issue in 17.5.4 |
@nohwnd Did you fix something about this problem in Microsoft.TestPlatform.TestHost 17.6.3 ? |
Yes there are fixes in TP 17.6.2 and 17.6.3, that are inserted into VS 17.6.4.v v17.6.1...v17.6.3 |
Thank you, @MarcoRossignoli and @nohwnd! It works as proposed to mark all projects which reference +
+ <!-- Exclude this project from the list of tests project -->
+ <TestProject>false</TestProject>
+ <IsTestProject>false</IsTestProject>
</PropertyGroup>
<ItemGroup>
@@ -22,4 +27,9 @@
<PackageReference Include="JetBrains.Annotations" />
</ItemGroup>
+ <ItemGroup>
+ <!-- This project takes depedency on nUnit that adds the TestContainer capability importing NUnit.props, but this is not a test project -->
+ <ProjectCapability Remove="TestContainer" />
+ </ItemGroup>
+
</Project> |
Thanks! This also solved the problem for us regarding exceptions but in our case we added it into .vcxproj files of Managed C++ for .NET6 which seemed to cause the Exceptions that I pasted above. Moreover, we increased the version numbers of the test adapters according to this blog https://www.damirscorner.com/blog/posts/20230616-MinimumMsTestVersionsForVs176.html
That may help others too |
So is the issue that projects which aren't test projects need to be marked as such? |
Uuuf. :) I saw just the first part of your message in preview on my phone, and was hoping that this is not another " Can confirm, this is broken for me as well".. |
Followed above advice for skipping projects without tests and updating nuget packages. it went from 19 errors to 2. Problem is I can't figure out the offending projects. Any way to figure out which project it's trying to load as a test and failing? |
If you run it with --diag:logs\log.txt you should be able to see more info in log.txt log file. There it should say which file it is processing. |
Thank you! Been pulling my hair out for the last day. I have both NET6 and Framework and 'Microsoft Unit Testing Framework for C++' tests in my solution and this issue has been a real problem |
Is this issue still awaiting a fix or is the fix to mark the offending projects TestProject False? I only have one project that doesn't contain tests and I have marked it and am still experiencing the same issue. I am on .Net 7.0 and have the latest version of the NUnit packages. It looks like the same issue other people are having. It looks like we are getting all of our tests because it is failing on that one project. We have frozen our Visual Studio at 17.5.4 until we know that this is fixed. Here are the logs just to confirm this is the same issue. If it isn't then I will do some more searching.
|
^^^ this |
This isn't working for me. I am on VS 17.5.4. Do I need to upgrade or is there something else I can check or another place I should be setting this rather than the project file? |
Try adding this item group to your project. <ItemGroup>
<ProjectCapability Remove="TestContainer" />
</ItemGroup> |
This worked! For whatever reason I had to remove and add back the dependencies of my projects to this project after doing this but now I am getting no failures. Thank you @nohwnd. |
As mentioned here, this issue would not prevent the testhost from crashing, it happens after, and so it is not severe enough to fix. |
Seeing this again in VS 17.10.5 with NUnit and .NET 8.0 - guessing there has been a regression somewhere. Yes, I have a reference to |
Could you please start a new issue and post a repro if you have one? |
I'm having a similar issue, and the build fails with the following trace running in Azure Devops hosted agents:
The issue started when moving from 17.5 to 17.6 two days ago.
Originally posted by @jeromelaban in #4467 (comment)
Update: To clarify this issue for future implementation of a fix. When testhost crashes in initialization, we don't communicate back that initialization did not happen and try to continue to the next step, which again does initialization and fails again. This will trigger cleanup 2 times via CompletedRun event, which cleans slots and pushes next work to be executed. First the cleanup will succeed, but the second one will fail. This also highlights that there is a disconnect between the work being done, and when we think the work already completed.
The text was updated successfully, but these errors were encountered: