Build/Test Issues

Error message: ERROR (Internal): System.Exception: Failed to extract test from its task

Started by ljohnston on 3,394 views

Hi,

I had a build fail with the error message below and would like some help troubleshooting it since it seems to be an internal NCrunch error message.

The tests are being run from TeamCity using NCrunch Console v3.18.0.2.

Re-running the build fixed the issue, but obviously it would be better if it didn't fail in the first place.

Here's what seems like the relevant excerpt from the TeamCity log, please let me know if there's any other info you'd like to help with troubleshooting it. It seems like after the failure it went on to run the rest of the tests without issue.

[14:52:18] :	 [Step 2/3] [LocalTestExecutionTask-140] Calling into task runner to run 3 tests: 
[14:52:18] :	 [Step 2/3] [LocalTestExecutionTask-140]       Sepialine.Argos.Commons.AspNetWebApi.Tests.WebServiceBaseUrlSpecs.when_representing_url_to_listen_on.should_represent
[14:52:18] :	 [Step 2/3] [LocalTestExecutionTask-140]       Sepialine.Argos.Commons.AspNetWebApi.Tests.WebServiceBaseUrlSpecs.when_representing_url_with_host_name.should_represent
[14:52:18] :	 [Step 2/3] [LocalTestExecutionTask-140]       Sepialine.Argos.Commons.AspNetWebApi.Tests.WebServiceBaseUrlSpecs.when_representing_url_with_ip.should_represent
[14:52:18] :	 [Step 2/3] [LocalBuildTask-365] Build was successful for C:\NCrunch\work\13360\9\BusinessObjects\BusinessObjects\bin\Release\BusinessObjects.dll
[14:52:18] :	 [Step 2/3] NCrunch build: BusinessObjects
[14:52:18] :	 [Step 2/3] [LocalBuildTask-301] Building new workspace C:\NCrunch\work\13360\24 for component Commons.Coordination in context of grid client (local)
[14:52:18] :	 [Step 2/3] [Core-275] Queuing 20 tests for passive execution
[14:52:18] :	 [Step 2/3] [Core-275] Queuing 15 tests for passive execution
[14:52:18] :	 [Step 2/3] [Core-275] Queuing 17 tests for passive execution
[14:52:18] :	 [Step 2/3] [Core-275] Queuing 5 tests for passive execution
[14:52:18] :	 [Step 2/3] [Core-275] Queuing 110 tests for passive execution
[14:52:18] :	 [Step 2/3] [Core-275] ERROR (Internal): System.Exception: Failed to extract test from its task
[14:52:18] :	 [Step 2/3] [Core-275]    at nCrunch.Client.TestPipeline.TestPipelineBuilder.RemoveTestsFromQueue(HashSet`1 testsToRemove, Boolean considerGridNode, GridNodeId gridNodeId, Boolean removeFromProcessedTasks)
[14:52:18] :	 [Step 2/3] [Core-275]    at nCrunch.Client.TestPipeline.TestPipelineBuilder.RemoveTestsFromQueue(IList`1 testsToRemove, Boolean considerGridNode, GridNodeId gridNodeId)
[14:52:18] :	 [Step 2/3] [Core-275]    at nCrunch.Client.TestPipeline.TestPipelineBuilder.QueueTestsForExecution(SnapshotComponent component, IList`1 testsToExecute, Boolean useDebugger, GridNodeId nodeToExecuteOn, Boolean executeWithHighPriority, ITaskGenerationModifier priorityCalculator, PerfTracker perfTracker)
[14:52:18] :	 [Step 2/3] [Core-275]    at nCrunch.Client.TestPipeline.TestPipelineManager. . ()
[14:52:18] :	 [Step 2/3] [Core-275]    at nCrunch.Common.PerformanceTracking.PerfTracker.TrackActivity(String name, Action activity)
[14:52:18] :	 [Step 2/3] [Core-275]    at nCrunch.Client.TestPipeline.TestPipelineManager. (IEnumerable`1  , DateTime  )
[14:52:18] :	 [Step 2/3] [Core-275]    at nCrunch.Client.TestPipeline.TestPipelineManager. (TestResultsOutdatedEvent  )

[14:51:36]E:	 [Step 2/3] Failed to extract test from its task - System.Exception: Failed to extract test from its task
   at nCrunch.Client.TestPipeline.TestPipelineBuilder.RemoveTestsFromQueue(HashSet`1 testsToRemove, Boolean considerGridNode, GridNodeId gridNodeId, Boolean removeFromProcessedTasks)
   at nCrunch.Client.TestPipeline.TestPipelineBuilder.RemoveTestsFromQueue(IList`1 testsToRemove, Boolean considerGridNode, GridNodeId gridNodeId)
   at nCrunch.Client.TestPipeline.TestPipelineBuilder.QueueTestsForExecution(SnapshotComponent component, IList`1 testsToExecute, Boolean useDebugger, GridNodeId nodeToExecuteOn, Boolean executeWithHighPriority, ITaskGenerationModifier priorityCalculator, PerfTracker perfTracker)
   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  )
[14:52:18]i:	 [Step 2/3] ##teamcity[buildProblem description='Failed to extract test from its task - System.Exception: Failed to extract test from its task|r|n   at nCrunch.Client.TestPipeline.TestPipelineBuilder.RemoveTestsFromQueue(HashSet`1 testsToRemove, Boolean considerGridNode, GridNodeId gridNodeId, Boolean removeFromProcessedTasks)|r|n   at nCrunch.Client.TestPipeline.TestPipelineBuilder.RemoveTestsFromQueue(IList`1 testsToRemove, Boolean considerGridNode, GridNodeId gridNodeId)|r|n   at nCrunch.Client.TestPipeline.TestPipelineBuilder.QueueTestsForExecution(SnapshotComponent component, IList`1 testsToExecute, Boolean useDebugger, GridNodeId nodeToExecuteOn, Boolean executeWithHighPriority, ITaskGenerationModifier priorityCalculator, PerfTracker perfTracker)|r|n   at nCrunch.Client.TestPipeline.TestPipelineManager. . ()|r|n   at nCrunch.Common.PerformanceTracking.PerfTracker.TrackActivity(String name, Action activity)|r|n   at nCrunch.Client.TestPipeline.TestPipelineManager. (IEnumerable`1  , DateTime  )|r|n   at nCrunch.Client.TestPipeline.TestPipelineManager. (TestResultsOutdatedEvent  )' timestamp='2018-08-15T14:52:18.299-0700']
[14:52:18] :	 [Step 2/3] [Core-275] Successfully completed execution of 3 tests on local machine
Hi, thanks for sharing this issue.

We've had this recently appear on our own build too. It seems to be caused by a complex series of rare interactions around the test pipeline and in the cases where I've been able to pin it down, it's been related to tests being added or removed to NCrunch's in-memory model. The problem looks to have been there for quite a while (years probably).

There's a fix coming for this in the next release. I expect that you likely won't see this again (it should be very rare). If it's repeating for you, try clearing out the NCrunch cache file on your build machine.

The result of this issue is that there may be a few tests that are not included in the run and won't be reported in the results.
The build below contains a fix for this issue if you're still seeing this happen:

NCrunch_Console_3.19.0.2.msi
NCrunch_Console_3.19.0.2.zip
NCrunch_GridNodeServer_3.19.0.2.msi
NCrunch_GridNodeServer_3.19.0.2.zip
NCrunch_LicenseServer_3.19.0.2.zip
NCrunch_VS2008_3.19.0.2.msi
NCrunch_VS2010_3.19.0.2.msi
NCrunch_VS2010_3.19.0.2.zip
NCrunch_VS2012_3.19.0.2.msi
NCrunch_VS2012_3.19.0.2.zip
NCrunch_VS2013_3.19.0.2.msi
NCrunch_VS2013_3.19.0.2.zip
NCrunch_VS2015_3.19.0.2.msi
NCrunch_VS2015_3.19.0.2.msi.7z
NCrunch_VS2015_3.19.0.2.zip
NCrunch_VS2017_3.19.0.2.msi
NCrunch_VS2017_3.19.0.2.msi.7z
NCrunch_VS2017_3.19.0.2.zip

Post a reply

Log in to reply.