Daily Usage Issues

NCrunch.exe "Code members in new coverage for test "

Started by GreenMoose on 3,433 views

[NCrunch Console Tool v3.22.0.1]

Today when running with a non existent NCrunch cache (1 local and 2 grid nodes active, node2 is pretty and limited to 1 test task) on TeamCity, NCrunch reported errors "Code members in new coverage for test":
[img=https://i.imgur.com/uiUEx3v.png]BuildProblems[/img]

Example of stack trace from build log:

[11:03:32] :	 [Step 14/20] [Core-50] Grid node node2.domain reports task completed: [LocalTestExecutionTask: [SnapshotComponent: Solution.Web.NonHttpIntegrationTests.NUnitTests, 32, 34492078], 8 test(s), NUnit, ProcessingSucceeded, ALGOL2, 62ab1cd6-a6ad-4226-86c7-b85f569d520b]
[11:03:32] :	 [Step 14/20] [Core-50] ERROR (Internal): nCrunch.Client.Model.CodeCoverage.CoverageMappingException: Code members in new coverage for test Solution.Web.NonHttpIntegrationTests.NUnitTests.OrderToolControllerIntegrationFixtures.SaveOrderItemFixture.OrderItemValueValidationFixture+RegexValidationFixture.IfValueStartsOrEndsWithWhitespaceItShouldBeTrimmedBeforeValidating(True," abc123 ") are reported out of order (Models\WebControls\DataFieldValueModel.cs:Presentation\Solution.Web\Solution.Web.csproj should be later than Models\ViewTemplateOptions\TextTabularForm2Options.cs:Presentation\Solution.Web\Solution.Web.csproj)
[11:03:32] :	 [Step 14/20] [Core-50]    at nCrunch.Client.Model.CodeCoverage.Indexes.CoverageIndex`1. (ModelTest  , ModelCodeMember  , Int32  , ModelCodeMember  , Int32  )
[11:03:32] :	 [Step 14/20] [Core-50]    at nCrunch.Client.Model.CodeCoverage.Indexes.CoverageIndex`1.MergeNewLineCoverageDataIntoIndexReturningChangedCodeMembers(ModelTest test, ComponentUniqueName componentUniqueName, ICoveragePointIterator`1 newCoveragePoints)
[11:03:32] :	 [Step 14/20] [Core-50]    at nCrunch.Client.Model.CodeCoverage.CoverageDatabase.MergeNewLineCoverageDataIntoDatabaseReturningChangedCodeMembers(ModelTest test, ComponentUniqueName componentUniqueName, ICoveragePointIterator`1 newCoveragePoints)
[11:03:32] :	 [Step 14/20] [Core-50]    at nCrunch.Client.Model.CodeCoverage.CodeCoverageMerger. (ModelTest  , Int64[]  , ComponentMappingData  , AssemblyClassMethodData  , Dictionary`2  , IDictionary`2  , ComponentUniqueName  )
[11:03:32] :	 [Step 14/20] [Core-50]    at nCrunch.Client.Model.CodeCoverage.CodeCoverageMerger. (ModelComponent  , ComponentMappingData  , ComponentTestExecutionMap  , AssemblyClassMethodData  , IDictionary`2  , HashSet`1  )
[11:03:32] :	 [Step 14/20] [Core-50]    at nCrunch.Client.Model.CodeCoverage.CodeCoverageMerger.MergeAndApplyCoverageResultsFromTestOutput(IEnumerable`1 componentsInTestDomain, HashSet`1 testsToMerge, ComponentTestExecutionMap[] componentTestExecutionMaps, IDictionary`2 mappingDataByComponentId, IDictionary`2 compiledFileVersionsById, IDictionary`2 assemblyClassMethodDataByComponent)
[11:03:32] :	 [Step 14/20] [Core-50]    at nCrunch.Client.Model.CodeCoverage.CodeCoverageMerger. (TestExecutionCompletedEvent  )

This error is the result of an internal consistency check performed when merging code coverage results into NCrunch's coverage database. The check basically verifies that the sequence of source files in the code coverage result is consistent with the sequence of source files in the build output.

I have never once seen this check fail before. The only thing I can think of that might cause it to fail is if somehow one of the binaries being used in your test environment is inconsistent with the rest of the session, i.e. perhaps you have an old binary from a previous session that has somehow been preserved and roped into the test environment. If you're able to reproduce this problem in a way that you can share with me, I should be able to dig deeper and figure out what is happening.
It is happening quite often on my CI build (with a large solution unfortunately) which is quite annoying because the build might take 30minutes and then fail due to this error and have to be re-executed without NCrunch cache (re-executing all tests), can I send create some NCrunch verbose output logs or whatever to help troubleshooting it?
Sorry to hear this. I'll try to do some analysis to narrow this down a bit. I'll let you know about the diagnostic build.
Could you try the build below and let me know if this solves the problem? Sorry, I had to change the grid protocol with this fix.

NCrunch_Console_3.23.0.9.msi
NCrunch_Console_3.23.0.9.zip
NCrunch_GridNodeServer_3.23.0.9.msi
NCrunch_GridNodeServer_3.23.0.9.zip
NCrunch_LicenseServer_3.23.0.9.zip
NCrunch_VS2008_3.23.0.9.msi
NCrunch_VS2010_3.23.0.9.msi
NCrunch_VS2010_3.23.0.9.zip
NCrunch_VS2012_3.23.0.9.msi
NCrunch_VS2012_3.23.0.9.zip
NCrunch_VS2013_3.23.0.9.msi
NCrunch_VS2013_3.23.0.9.zip
NCrunch_VS2015_3.23.0.9.msi
NCrunch_VS2015_3.23.0.9.msi.7z
NCrunch_VS2015_3.23.0.9.zip
NCrunch_VS2017_3.23.0.9.msi
NCrunch_VS2017_3.23.0.9.msi.7z
NCrunch_VS2017_3.23.0.9.zip
Thanks, it seems to work:
I had another issue today so I re-run the build with version 3.23 the error went away, no grid nodes involved though since I kept those at 3.22.

However I was not able to reproduce it when reverting back to 3.22 to verify it but I'll keep using 3.23 (incl. grid nodes) and hope for the best :)

Post a reply

Log in to reply.