[NCrunch Console Tool v3.22.0.1]
First of all here is the NCrunch.exe parameters
Code:
[08:48:07] :	 [Step 14/20] &"X:\_tmp\NConsole\NCrunch.exe" SOLUTION.sln /o "X:\_tmp\NCResults" -NCrunchCacheStoragePath "X:\_tmp\NCCache" -WorkspaceBasePath "X:\_tmp\NcWc"  /vs "2012" -ConsiderInconclusiveTestsAsPassing True -MaxNumberOfProcessingThreads 2  /TeamCityDisableTestNotRunFailureReporting -AnalyseExecutionTimes "False" -PipelineOptimisationPriority "Throughput" /C "X:\_tmp\ncrunchConfig.xml" /e "TeamCityEngineMode-2018-12-07T08:48:07" -Capabilities "LocalOnly" -AlignOutOfDateStatusWithImpactStatus "True" -TestsToExecuteAutomatically "(DoesNotHaveCategory 'LongRunningTest' AND DoesNotHaveCategory 'SystemTimeModifyingTest' AND (HasNotBeenRun OR IsImpacted OR IsFailing OR FullNameMatchesRegex 'SchemaOnDiskIsLatest'))"
 and here is the config xml file I use:
Code:
[08:48:07] :	 [Step 14/20] NCrunchXmlConfig
[08:48:07] :		 [NCrunchXmlConfig] <GlobalConfiguration>
[08:48:07] :		 [NCrunchXmlConfig]   <Settings>
[08:48:07] :		 [NCrunchXmlConfig]     <GridServerReferencesForComputer>
[08:48:07] :		 [NCrunchXmlConfig]       <Value>s1>XXX=</Value>
[08:48:07] :		 [NCrunchXmlConfig]       <Value>s2>YffCWkdsdaCoN6GXXXApR1RoqeBRaXd6S66NdP4BsJnIno=</Value>
[08:48:07] :		 [NCrunchXmlConfig]     </GridServerReferencesForComputer>
[08:48:07] :		 [NCrunchXmlConfig]   </Settings>
[08:48:07] :		 [NCrunchXmlConfig]   <EngineModes>
[08:48:07] :		 [NCrunchXmlConfig]     <EngineMode>
[08:48:07] :		 [NCrunchXmlConfig]       <Name>TeamCityEngineMode-2018-12-07T08:48:07</Name>
[08:48:07] :		 [NCrunchXmlConfig]       <Settings>
[08:48:07] :		 [NCrunchXmlConfig]         <CustomEnvironmentVariables>
[08:48:07] :		 [NCrunchXmlConfig]           <Value>Configuration = Release</Value>
[08:48:07] :		 [NCrunchXmlConfig]           <Value>TestsConnectionString = Server=(local);Initial Catalog=NCrunch_%username%;Integrated Security=SSPI</Value>
[08:48:07] :		 [NCrunchXmlConfig]           <Value>UtilsTestsConnectionString = Server=(local);Initial Catalog=NCrunch_tils_%username%;Integrated Security=SSPI</Value>
[08:48:07] :		 [NCrunchXmlConfig]           <Value>IgnoreTestsResettingDb = True</Value>
[08:48:07] :		 [NCrunchXmlConfig]           <Value>ResetDbIfSchemaIsOutdated = True</Value>
[08:48:07] :		 [NCrunchXmlConfig]         </CustomEnvironmentVariables>
[08:48:07] :		 [NCrunchXmlConfig]       </Settings>
[08:48:07] :		 [NCrunchXmlConfig]     </EngineMode>
[08:48:07] :		 [NCrunchXmlConfig]   </EngineModes>
[08:48:07] :		 [NCrunchXmlConfig] </GlobalConfiguration>
 Build fails due to NCrunch reporting test failure. Below is the only test executed on S1 node (searched for "s1.*LocalTestExecutionTask" in build log)
Code:
[08:50:37] :     [Step 14/20] [Core-106] Grid node s1.domain reports task completed: [LocalTestExecutionTask: [SnapshotComponent: SOLUTION.Tests.MappingFixtures.NUnitTests, 48, 13152069], 1 test(s), NUnit, ProcessingSucceeded, S1, b14ffe89-f587-4c52-a5da-d2f9f2b849d8]
[08:50:37] :     [Step 14/20] [LocalBuildTask-17] Now building SOLUTION.DataLoader.Tests
[08:50:38] :     [Step 14/20] SOLUTION.Tests.MappingFixtures.NUnitTests : SOLUTION.Tests.MappingFixtures.NUnitTests.ExportSchemaFixtures.ExportSchemaToFileFixture.SchemaOnDiskIsLatest
[08:50:38] :         [SOLUTION.Tests.MappingFixtures.NUnitTests : SOLUTION.Tests.MappingFixtures.NUnitTests.ExportSchemaFixtures.ExportSchemaToFileFixture.SchemaOnDiskIsLatest] [Test Output]
NCrunch: This test was executed on server 'S1'
Verifying schema 'E:\NCGNode\Workspaces\7464\845\Tests\Proj.Tests.MappingFixtures.NUnitTests\bin\Release\GeneratedSqlSchema/db_schema.sql' is up to date.
[08:50:38] :     [Step 14/20] Proj.Tests.MappingFixtures.NUnitTests : Proj.Tests.MappingFixtures.NUnitTests.ExportSchemaFixtures.ExportSchemaToFileFixture._Fixture_
[08:50:38] :         [Proj.Tests.MappingFixtures.NUnitTests : Proj.Tests.MappingFixtures.NUnitTests.ExportSchemaFixtures.ExportSchemaToFileFixture._Fixture_] [Test Output]
NCrunch: This test was executed on server 'S1'
 And log has no trace of test failures (searching for "fail"), except these lines:
Code:
[08:56:21] :     [Step 14/20] [?-1] Reporting engine execution results
[08:56:51] :     [Step 14/20] [-0] Execution result based on:
Load errors: False
Failed tasks: False
Failed tests: True
Not run tests: True
[08:56:53]E:     [Step 14/20] NCrunch result: TestFailure
[08:56:51]i:     [Step 14/20] ##teamcity[buildProblem description='NCrunch result: TestFailure' timestamp='2018-12-07T08:56:51.843+0100']
<snip> 
[08:57:10] :     [Step 14/20] [Core-141] Cleaning up workspace: X:\_tmp\NcWc\7548\32
[08:57:13] :     [Step 14/20] [?-1] Returning result: OK
[08:57:13] :     [Step 14/20] Exit code: #0
[08:57:13] :     [Step 14/20] Process exited with code 0
[08:57:13]E:     [Step 14/20] Step Build with NCrunch (PowerShell) failed
[08:57:18]E:     [Step 14/20] Error message is logged
 But according to NCrunch result HTML, it has 5 "fixtures" failing (incl. the one with clipped text), all on the S1 grid node (log states "Server used: S1").:

(The "tests passed 14 920" is referring to NCrunch cache since since this test run only executed a few tests that were previously failing).
And when looking at the "Show test output text" link, it shows output from an old test run (looking at the timestamp):
Code:
18:49:38.628 [7] DEBUG UnitTestHelper (null) - <Some old text referring to an old environment variable value no longer part of the builds>.
 I.e. Is there a bug somewhere causing the "fixture failure state" not being cleared , if a test no longer is failing for whatever reason, if I use the NCrunch cache to only run failed or impacted tests?