Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Failure at analysis step
MaxRonin
#1 Posted : Thursday, December 10, 2020 1:00:08 PM(UTC)
Rank: Member

Groups: Registered
Joined: 3/18/2016(UTC)
Posts: 22
Location: Austria

Thanks: 4 times
Was thanked: 2 time(s) in 2 post(s)
Hi,

tldr:

In one of my test projects I get the error
Quote:
An error occurred while analysing this project after it was built: NCrunch encountered an unexpected error occurred while building an environment to analyse an assembly: nCrunch.TaskRunner.Ipc.IpcConnectionClosedException: The connection has been closed
at nCrunch.Core.ProcessManagement.ExternalProcessManager.(EffectiveProcessorArchitecture , ProcessLoadParameters )
at nCrunch.Core.ProcessManagement.ExternalProcessManager.LoadExternalProcess(ProcessLoadParameters parameters, GridClientId client)
at nCrunch.Core.TestManagement.TestRunnerProcess..()
at nCrunch.Common.PerformanceTracking.PerfTracker.TrackActivity(String name, Action activity)
at nCrunch.Core.TestManagement.TestRunnerProcess.(Nullable`1 , FilePath , GridClientId , CustomVariable[] )
at nCrunch.Core.TestManagement.TestRunnerProcess..()
at nCrunch.Common.PerformanceTracking.PerfTracker.TrackActivity(String name, Action activity)
at nCrunch.Core.TestManagement.TestRunnerProcess.LoadTestRunnerProcessForProjectReturningProcessId(SnapshotComponent snapshotComponent, IList`1 componentsInProcess, TestFrameworkDescription[] testingFrameworks, Nullable`1 newProcessTag, FilePath solutionFilePath, GridClientId client, CustomVariable[] customEnvironmentVariables)
at nCrunch.Core.Processing.AnalysisTaskLogic.DoProcessTaskAndReturnSuccessFlag()



Details:
My solution has plenty of other test projects which, as far as I can tell, look exactly the same. They all work just fine.

I checked into the workspace directory of NCrunch, and the project is being built successfully. On the other hand, the error message also states "after it was built".

The only somewhat strange thing is that I see in NCrunch's window just before the error a warning:
Quote:
WARNING - ..\..\..\..\..\..\Users\myusername\.nuget\packages\microsoft.sourcelink.common\1.0.0\build\Microsoft.SourceLink.Common.targets (52, 5): : Source control information is not available - the generated source link is empty.


This is odd insofar as my sourcelink related settings all come from a Directory.Build.props file in the root of the solution in which I've explicitly activated them only for non-ncrunch builds:

Code:
    
<PropertyGroup>
    <Version>1.4.800</Version>
    <GeneratePackageOnBuild>false</GeneratePackageOnBuild>
</PropertyGroup>
<PropertyGroup Condition="'$(NCrunch)' != '1'">
    <PublishRepositoryUrl>true</PublishRepositoryUrl>
    <EmbedAllSources>true</EmbedAllSources>
    <DebugType>embedded</DebugType>
    <DebugSymbols>true</DebugSymbols>
    <AllowedOutputExtensionsInPackageBuildOutputFolder>$(AllowedOutputExtensionsInPackageBuildOutputFolder);.pdb</AllowedOutputExtensionsInPackageBuildOutputFolder>
</PropertyGroup>
<ItemGroup Condition="'$(NCrunch)' != '1'">
    <PackageReference Include="Microsoft.SourceLink.AzureRepos.Git" Version="1.*" PrivateAssets="All" />
</ItemGroup>
<PropertyGroup Condition="'$(TF_BUILD)' == 'true'">
    <ContinuousIntegrationBuild>true</ContinuousIntegrationBuild>
</PropertyGroup>


so it's strange where that warning comes from. But on the other hand, the warning
a) appears in all other test projects, too, which don't have the analysis error
b) is an output of the build which runs successfully

I can run the tests outside NCrunch just fine, for example with
Code:

dotnet test


So right now I got no idea how I can further debug this to find out what's the problem. Any help would be very much appreciated.
Thanks,
MR
Remco
#2 Posted : Thursday, December 10, 2020 11:49:44 PM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 6,248

Thanks: 810 times
Was thanked: 1077 time(s) in 1022 post(s)
Hi,

Thanks for sharing this problem.

This is a catch all exception that gets thrown when the task runner process suddenly disappears without providing any error information. Typically, it's infrastructure or dependency related.

In this case, the exception is thrown before the process has finished initialising. So I think this is being caused by something in your environment.

A few things to check:
- Do you see anything in your windows event viewer that might give more useful information?
- Does changing the build platform (i.e. x86/x64) make any difference?
- Are you able to produce this problem on the same machine by creating new empty test projects with the same settings? (i.e. same version of .NET etc)

The sourcelink issue is not related and is just a red herring.
MaxRonin
#3 Posted : Friday, December 11, 2020 10:19:56 AM(UTC)
Rank: Member

Groups: Registered
Joined: 3/18/2016(UTC)
Posts: 22
Location: Austria

Thanks: 4 times
Was thanked: 2 time(s) in 2 post(s)
Hi Remco,

I didn't find anything in the eventlog etc., but I managed to pare the test project and the production project down to where they have:
*) no other project references
*) no code files except one testfixture in the test project

and the problem still happens.

I've created a private Github repo with this repro. Can I invite you to it and you take a look? What's your github username?

Cheers,
MR
Remco
#4 Posted : Friday, December 11, 2020 11:37:15 AM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 6,248

Thanks: 810 times
Was thanked: 1077 time(s) in 1022 post(s)
MaxRonin;15175 wrote:

I've created a private Github repo with this repro. Can I invite you to it and you take a look? What's your github username?


Any chance you could zip up the source and put it through the contact form?
MaxRonin
#5 Posted : Friday, December 11, 2020 11:52:56 AM(UTC)
Rank: Member

Groups: Registered
Joined: 3/18/2016(UTC)
Posts: 22
Location: Austria

Thanks: 4 times
Was thanked: 2 time(s) in 2 post(s)
Done :-)
Remco
#6 Posted : Saturday, December 12, 2020 12:32:01 AM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 6,248

Thanks: 810 times
Was thanked: 1077 time(s) in 1022 post(s)
Thanks for sending through the sample.

Your code works fine on my end. This problem is not related to the codebase. Something is not right in your environment.

Can you try the following?

1. Set your Log Verbosity to Detailed
2. In your cut down sample solution, open up NCrunch and let the engine run through until the error appears
3. Submit an NCrunch bug report (using the NCrunch menu).

The log file in the report may help with identifying the source of failure.
MaxRonin
#7 Posted : Sunday, December 13, 2020 11:39:51 AM(UTC)
Rank: Member

Groups: Registered
Joined: 3/18/2016(UTC)
Posts: 22
Location: Austria

Thanks: 4 times
Was thanked: 2 time(s) in 2 post(s)
Done
Remco
#8 Posted : Monday, December 14, 2020 12:34:09 AM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 6,248

Thanks: 810 times
Was thanked: 1077 time(s) in 1022 post(s)
Thanks for submitting the report. I found the error below. Note that this wouldn't necessarily show up when running your tests under the VS tools, as these tend to quietly shift to different versions of the framework when they run your tests.


[11:38:11.8383-ProcessOutputRedirectionErr-20] Process 32600: The framework 'Microsoft.AspNetCore.App', version '3.1.10' was not found.
[11:38:11.8383-ProcessOutputRedirectionErr-20] Process 32600: - The following frameworks were found:
[11:38:11.8383-ProcessOutputRedirectionErr-20] Process 32600: 2.1.23 at [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
[11:38:11.8383-ProcessOutputRedirectionErr-20] Process 32600: 3.1.9 at [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
[11:38:11.8383-ProcessOutputRedirectionErr-20] Process 32600: 5.0.0 at [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
[11:38:11.8383-ProcessOutputRedirectionErr-20] Process 32600: 5.0.1 at [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
[11:38:11.8383-ProcessOutputRedirectionErr-20] Process 32600:
[11:38:11.8383-ProcessOutputRedirectionErr-20] Process 32600: You can resolve the problem by installing the specified framework and/or SDK.
[11:38:11.8383-ProcessOutputRedirectionErr-20] Process 32600:
[11:38:11.8383-ProcessOutputRedirectionErr-20] Process 32600: The specified framework can be found at:
[11:38:11.8383-ProcessOutputRedirectionErr-20] Process 32600: - https://aka.ms/dotnet-co...ch=x64&rid=win10-x64
1 user thanked Remco for this useful post.
MaxRonin on 12/14/2020(UTC)
MaxRonin
#9 Posted : Monday, December 14, 2020 10:32:27 AM(UTC)
Rank: Member

Groups: Registered
Joined: 3/18/2016(UTC)
Posts: 22
Location: Austria

Thanks: 4 times
Was thanked: 2 time(s) in 2 post(s)
Thanks, that was it.

For anyone else who might be having a similar issue:

You can check your installed runtimes with

Code:
dotnet --list-runtimes


Be careful about the distinction between Microsoft.NETCore.App 3.1.10 and Microsoft.AspNetCore.App 3.1.10


In my case I had the first already installed, same for .WindowsDesktop., but .AspNetCore. was missing - how this happened, seeing as up until now I never installed runtimes manually, only through Visual Studios's installer, is a question that will probably be never answered.

I don't really understand why building and running tests both from within VS and from the command-line directly with
Code:
dotnet test
never showed any problem, but I'll keep checking for such missing entries in the SDK table on my list for future troubleshooting.



Thanks again, Remco, for your really exceptional support and help!


(And of course for NCrunch itself - I've been using it for ~8 years, and I can't/don't want to imagine development without it anymore.)
1 user thanked MaxRonin for this useful post.
Remco on 12/14/2020(UTC)
Users browsing this topic
Guest
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

YAF | YAF © 2003-2011, Yet Another Forum.NET
This page was generated in 0.246 seconds.
Trial NCrunch
Take NCrunch for a spin
Do your fingers a favour and supercharge your testing workflow
Free Download