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

Notification

Icon
Error

NullReferenceException from TestPipelineManager
robert-j-engdahl
#1 Posted : Tuesday, October 2, 2018 10:05:47 AM(UTC)
Rank: Member

Groups: Registered
Joined: 1/26/2017(UTC)
Posts: 13
Location: Denmark

Thanks: 4 times
Our TeamCity (which uses distributed NCrunch for testing) occationally fail with errors similar to the following:

Quote:
Object reference not set to an instance of an object. - System.NullReferenceException: Object reference not set to an instance of an object.
at nCrunch.Client.TestPipeline.TestPipelineManager. (IEnumerable`1 )
at nCrunch.Client.TestPipeline.TestPipelineManager. (TestDataUpdatedEvent )


The following error also appear

Quote:
Object reference not set to an instance of an object. - System.NullReferenceException: Object reference not set to an instance of an object.
at nCrunch.Client.Model.ModelCodeMember.get_FilePath()
at nCrunch.Client.Navigation.CodeNavigationSynchroniser. (ModelTest )
at nCrunch.Client.Navigation.CodeNavigationSynchroniser. (ModelTest , CodeNavigationIndexUpdate )
at nCrunch.Client.Navigation.CodeNavigationSynchroniser. (TestDataUpdatedEvent )


There seem to be no failing tests, only a failed integration because of the above.

NCrunch is invoked with

Quote:
"C:\Program Files (x86)\Remco Software\NCrunch Console Tool\NCrunch.exe" C:\TeamCity\buildAgent\work\89f512a38888334a\master.sln /c C:\TeamCity\buildAgent\work\89f512a38888334a\teamcity.crunch.v3.xml /e "TeamCity Continues Integration" /o NCrunchResults /TeamCityDisableTestNotRunFailureReporting -LogVerbosity Summary


The teamcity.crunch.v3.xml contains the following:

Quote:
<GlobalConfiguration>
<Settings>
<CPUCoresAssignedToNCrunch>0,1,2,3,4,5,6,7</CPUCoresAssignedToNCrunch>
<CPUCoresAssignedToVisualStudio></CPUCoresAssignedToVisualStudio>
<FastLaneThreads>1</FastLaneThreads>
<GridReconnectionDelayInSeconds>0</GridReconnectionDelayInSeconds>
<GridServerReferencesForComputer>
<!-- <Value>BuildAgent1:80&gt;</Value> -->
<!-- <Value>askvision:80&gt;</Value> -->
<!--<Value>pgpvision:80&gt;</Value>-->
<!--<Value>mkpvision:80&gt;</Value>-->
<!-- <Value>jnyvision:80&gt;</Value> -->
<Value>rjevision:80&gt;</Value>
<!-- <Value>jlsvision:80&gt;</Value> -->
</GridServerReferencesForComputer>
<DisabledNodes>
<Value>(local):0</Value>
</DisabledNodes>
<MaxNumberOfProcessingThreads>8</MaxNumberOfProcessingThreads>
<MaxTestRunnerProcessesToPool>1</MaxTestRunnerProcessesToPool>
<AllowParallelTestExecution>True</AllowParallelTestExecution>
<SystemConfigured>True</SystemConfigured>
<TerminateTestRunnerTasksOnExecutionComplete>False</TerminateTestRunnerTasksOnExecutionComplete>
<UseSimplifiedSettingsWhereAvailable>True</UseSimplifiedSettingsWhereAvailable>
<NCrunchCacheStoragePath>c:\ncrunch</NCrunchCacheStoragePath>
</Settings>
<EngineModes>
<EngineMode>
<Name>TeamCity Continues Integration</Name>
<Settings>
<TestsToExecuteAutomatically>(DoesNotHaveCategory 'TeamCityIgnore')</TestsToExecuteAutomatically>
</Settings>
</EngineMode>
</EngineModes>
</GlobalConfiguration>


The grid server references that are commented out is because we experience the shortest integration time when there is only one node operational. But that is a different issue.
Remco
#2 Posted : Tuesday, October 2, 2018 10:32:57 AM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 7,161

Thanks: 964 times
Was thanked: 1296 time(s) in 1202 post(s)
Hi, thanks for sharing these issues.

These problems look to be downstream issues caused by corruption of NCrunch's .cache file. Does wiping out your cache file on the TeamCity server resolve them?
robert-j-engdahl
#3 Posted : Tuesday, October 2, 2018 11:13:31 AM(UTC)
Rank: Member

Groups: Registered
Joined: 1/26/2017(UTC)
Posts: 13
Location: Denmark

Thanks: 4 times
So I just cleared the cache but now the following error is back:

Quote:

Object reference not set to an instance of an object. - System.NullReferenceException: Object reference not set to an instance of an object.
at nCrunch.Client.TestPipeline.TestPipelineManager. (IEnumerable`1 )
at nCrunch.Client.TestPipeline.TestPipelineManager. (TestDataUpdatedEvent )
Object reference not set to an instance of an object. - System.NullReferenceException: Object reference not set to an instance of an object.
at nCrunch.Client.Model.ModelCodeMember.get_FilePath()
at nCrunch.Client.Navigation.CodeNavigationSynchroniser. (ModelTest )
at nCrunch.Client.Navigation.CodeNavigationSynchroniser. (ModelTest , CodeNavigationIndexUpdate )
at nCrunch.Client.Navigation.CodeNavigationSynchroniser. (TestDataUpdatedEvent )
Object reference not set to an instance of an object. - System.NullReferenceException: Object reference not set to an instance of an object.
at nCrunch.Client.TestPipeline.TestPipelineManager. (IEnumerable`1 )
at nCrunch.Client.TestPipeline.TestPipelineManager. . ()
at nCrunch.Common.PerformanceTracking.PerfTracker.TrackActivity(String name, Action activity)
at nCrunch.Client.TestPipeline.TestPipelineManager. (IEnumerable`1 , DateTime )
at nCrunch.Client.TestPipeline.TestPipelineManager. (TestResultsOutdatedEvent )
Remco
#4 Posted : Tuesday, October 2, 2018 11:35:56 AM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 7,161

Thanks: 964 times
Was thanked: 1296 time(s) in 1202 post(s)
Can you confirm if you have any of the following?

- Multi-targeted projects
- Projects that have been ignored by NCrunch using the 'Ignore this component completely' setting
- A NCrunch cache file/location that is used by more than one solution (.sln)
- Any projects that might be routinely removed and readded to the solution
robert-j-engdahl
#5 Posted : Tuesday, October 2, 2018 12:07:28 PM(UTC)
Rank: Member

Groups: Registered
Joined: 1/26/2017(UTC)
Posts: 13
Location: Denmark

Thanks: 4 times
Projects that are routinely removed and readded, sure; we definitely have these. All our feature branches run on the same TeamCity, so new projects aren't created on all branches at the same time. This could make it appear as if it was removed and added again all the time. The cache file location is shared across branches.
robert-j-engdahl
#6 Posted : Tuesday, October 2, 2018 1:21:12 PM(UTC)
Rank: Member

Groups: Registered
Joined: 1/26/2017(UTC)
Posts: 13
Location: Denmark

Thanks: 4 times
Now I get

Quote:
Configuration setting ''NCrunch cache storage path'' was not found


After adding

Quote:
-'NCrunch cache storage path' C:\ncrunch\%teamcity.build.branch%\


to the NCrunch.exe invocation.
Remco
#7 Posted : Wednesday, October 3, 2018 12:17:27 AM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 7,161

Thanks: 964 times
Was thanked: 1296 time(s) in 1202 post(s)
Thanks for the extra details. This will help me to track down the problem. Meanwhile, I would definitely suggest having a different cache file for each build. Cross-talk between the builds can result in all kinds of efficiency issues.

The command-line configuration setting names are the same as they are in the XML files, so the correct override in this instance is:

-NCrunchCacheStoragePath c:\mystoragedir\build1
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.052 seconds.
Trial NCrunch
Take NCrunch for a spin
Do your fingers a favour and supercharge your testing workflow
Free Download