-
Notifications
You must be signed in to change notification settings - Fork 325
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
CollectDumpOnTestSessionHang doesn't produce a dump file #2375
Comments
I should add that the sequence file was very helpful, but I was still surprised not to see a crash dump. |
After quick analysis I found quite a few problems, most of them would be mitigated by logging errors to the client correctly:
I am afraid we won't be able to get to this anytime soon, but it should be reasonably simple to fix, please consider PRing this 🙂 <RunSettings>
<RunConfiguration>
<MaxCpuCount>4</MaxCpuCount>
</RunConfiguration>
<DataCollectionRunSettings>
<DataCollectors>
<DataCollector friendlyName="blame" enabled="True">
<Configuration>
<ResultsDirectory>blame</ResultsDirectory>
<CollectDumpOnTestSessionHang TestTimeout="5000" DumpType="full"/>
</Configuration>
</DataCollector>
</DataCollectors>
</DataCollectionRunSettings>
</RunSettings> using Microsoft.VisualStudio.TestTools.UnitTesting;
namespace UnitTestProject60
{
[TestClass]
public class UnitTest1
{
[TestMethod]
public void TestMethod1()
{
System.Threading.Thread.Sleep(100_000);
}
}
} I am using |
Sorry, I didn't have PROCDUMP_PATH set, so that's likely the issue. I can't believe I missed that in the documentation. I'll see if I can create a PR for the problems you found. |
@provegard please do. You can tag me to help out with the review. |
@ShreyasRmsft I have trouble building the repo code using
I follow these contribution guidelines I have .NET 4.6.1 and 4.7. I cannot install 4.6.2 because it says there's a newer one installed already (4.7, obviously). The doc says "4.6.2 or higher", so that should be fine. I have installed the two MSIs for the 4.6 targeting pack. Any ideas? |
@provegard do you have VS2017 or VS2019? I remember someone else facing issues with 2019, the build scripts are slightly outdated. If you are on VS2019, try getting VS2017. But before that also try setting up 4.6.2 developer pack from https://dotnet.microsoft.com/download/dotnet-framework/net462. Also one other thing to try is to install the 4.6.2 sdk from visual studio installer itself and maybe remove the MSIs. |
Problem solved, the part about 4.6 targeting pack was a red herring. Installing VS extension development support in VS2017 did it. |
The unit tests pass. Smoke and platform tests fail (the platform tests actually hang). Also, when I open the solution in VS2017, I get:
I have .NET 4.6.1, 4.6.2, 4.7, 4.7.2 as well as long range of .NET Core SDKs:
Any ideas? |
Example of smoke test failure:
Another:
Are they environment-specific? I'm on Windows as noted before. |
Platform test failures:
And this one is fun:
I need to mount another drive letter it seems. :-) |
I'm not trying to be annoying here, just wondering if you (maintainers/collaborators) are seeing these test errors as well? |
I think you need VS enterprise, some of these dlls are only shipped on the enterprise version like "Microsoft.VisualStudio.CodeCoverage.Shim". Hehe these are pretty outdated, go ahead with only the UTs locally. The acceptance and smoke tests will get validated on the CI. Plus I don't think blame data collector has any E2E tests. |
Still having bad luck with VS. Lots of errors. It seems I need to have .NET 4.5.1 installed as well to get things to compile. I feel that my disk is slowly filling up with all possible .NET versions. :-D |
@nohwnd did you end up facing any of these initial setup issues when you first cloned the repo? I never encountered these because my VS was already pretty much loaded with all the possible skus and extensions. |
@provegard sorry, been busy with release. Hope you did not give up. I am installing VS Community to see if I can build. I am pretty sure I was able to do it before. |
Thanks, I'll give it a try! |
Related #2380 |
@provegard , any update on this issue? |
Actually there is a lot. In the latest net5.0 release (I think since preview6). We are leveraging the Diagnostics NetCore client to create hang dumps. This works on Windows (with any target framework) and Linux (with netcoreapp3.1 and newer). There is no need for procdump.exe when creating hang dumps, or for the temporary folder. To trigger a hang dump you can now simply do: For crash dumps the situation is similar as before, but it errors out a bit better. There you still need procdump, because that flow needs to attach to a running process and detect failure, which is no easy task. But luckily crash dumps are usually way less interesting than hang dumps, because when the process crashes it often has an eay to see reason. From dotnet test help:
|
The additional options were shipped long time ago. There is still dependency on procdump for some of the workflows (most importantly collecting crash dump on windows). It is very complicated internally, because we are dealing with multiple platforms, approaches to dumping, that not always work and manually deploying procdump. For azdo agents, the easiest way to deploy procdump is using chocolatey. It will install it in PATH and vstest will pick it up. For diagnosing issues with dumps, I highly suggest you enable the diagnostic logs, e.g |
Description
I'm trying to troubleshoot hanging builds on a CI server. I found this which seems very promising:
https://github.com/microsoft/vstest-docs/blob/master/RFCs/0028-BlameCollector-Hang-Detection.md
However, when I use the hang detector, I don't get a dump file.
Steps to reproduce
The test hangs are intermittent, so they are hard to reproduce.
dotnet vstest
is invoked with:The settings file is auto generated and contains something like this:
Expected behavior
I expect the hang detector to detect a hang and produce a crash dump file.
Actual behavior
The hang detector did detect a hang after ~2 minutes:
However, it only produces a sequence file, not a crash dump.
Note that the sequence file ends up in the result directory used on the command line, rather than the results directory in the settings file.
Diagnostic logs
None produced by the above command.
Environment
Windows Server 2012
.NET Core version 3.0.100
The text was updated successfully, but these errors were encountered: