0
votes

I have a test project that runs locally without problem but it fails on our two build agents with the following message:

"Process exited with code -4 (Step: Run unit tests release MeasurementProgram(NUnit))"

What does "code -4" mean? Is it a TeamCity or NUnit error message? I have searched google for this particular error message but found nothing.

The build log for the failing build step looks like this:

[10:54:33][Step 8/10] Starting: C:\TeamCity\buildAgent\work\a6c5ca0ef741ad5d\MeasurementProgram\packages\NUnit.ConsoleRunner.3.9.0\tools\nunit3-console.exe C:\TeamCity\buildAgent\temp\agentTmp\TUcUi6YjpZJlgpN1V44wTaX11CzkLXy5.nunit --result=C:\TeamCity\buildAgent\temp\agentTmp\TUcUi6YjpZJlgpN1V44wTaX11CzkLXy5.nunit.xml --noheader --where (cat==LongRunning||cat==AlgorithmLongRunning||cat==PerformanceLongRunning||cat==RegressionTestLongRunning||cat==IntegrationTestLongRunning||cat==DoseRegressionLongRunning)&&cat!=AlgorithmInvestigation&&cat!=TestTools --framework=net-4.0 --inprocess
[10:54:33][Step 8/10] in directory: C:\TeamCity\buildAgent\work\a6c5ca0ef741ad5d\MeasurementProgram\DeviceCtrl.Test\bin\Release
[10:54:33][Step 8/10] Runtime Environment
[10:54:33][Step 8/10]    OS Version: Microsoft Windows NT 6.3.9600.0
[10:54:33][Step 8/10]   CLR Version: 4.0.30319.42000
[10:54:33][Step 8/10] 
[10:54:33][Step 8/10] Test Files
[10:54:33][Step 8/10]     C:\TeamCity\buildAgent\temp\agentTmp\TUcUi6YjpZJlgpN1V44wTaX11CzkLXy5.nunit
[10:54:33][Step 8/10] 
[10:54:33][Step 8/10] Test Filters
[10:54:33][Step 8/10]     Where: (cat==LongRunning||cat==AlgorithmLongRunning||cat==PerformanceLongRunning||cat==RegressionTestLongRunning||cat==IntegrationTestLongRunning||cat==DoseRegressionLongRunning)&&cat!=AlgorithmInvestigation&&cat!=TestTools
[10:54:33][Step 8/10] 
[10:54:33][Step 8/10] 
[10:54:33][Step 8/10] Errors, Failures and Warnings
[10:54:33][Step 8/10] 
[10:54:33][Step 8/10] 1) Invalid : C:\TeamCity\buildAgent\temp\agentTmp\TUcUi6YjpZJlgpN1V44wTaX11CzkLXy5.nunit
[10:54:33][Step 8/10] File type is not supported
[10:54:33][Step 8/10] 
[10:54:33][Step 8/10] Test Run Summary
[10:54:33][Step 8/10]   Overall result: Failed
[10:54:33][Step 8/10]   Test Count: 0, Passed: 0, Failed: 0, Warnings: 0, Inconclusive: 0, Skipped: 0
[10:54:33][Step 8/10]   Start time: 2019-09-16 08:54:33Z
[10:54:33][Step 8/10]     End time: 2019-09-16 08:54:33Z
[10:54:33][Step 8/10]     Duration: 0.026 seconds
[10:54:33][Step 8/10] 
[10:54:33][Step 8/10] Results (nunit3) saved as C:\TeamCity\buildAgent\temp\agentTmp\TUcUi6YjpZJlgpN1V44wTaX11CzkLXy5.nunit.xml
[10:54:34][Step 8/10] Process exited with code -4
[10:54:34][Step 8/10] NUnit process finished with negative exit code -4 (unexpected failure). Reporting step failure.
[10:54:34][Step 8/10] Publishing artifacts
[10:54:34][Publishing artifacts] Collecting files to publish: [C:\TeamCity\buildAgent\temp\agentTmp\TUcUi6YjpZJlgpN1V44wTaX11CzkLXy5.nunit => .teamcity\bt42_RUNNER_76]
[10:54:34][Publishing artifacts] Publishing 1 file using [ArtifactsCachePublisher]: C:/TeamCity/buildAgent/temp/agentTmp/TUcUi6YjpZJlgpN1V44wTaX11CzkLXy5.nunit => .teamcity/bt42_RUNNER_76
[10:54:34][Publishing artifacts] Publishing 1 file using [WebPublisher]: C:/TeamCity/buildAgent/temp/agentTmp/TUcUi6YjpZJlgpN1V44wTaX11CzkLXy5.nunit => .teamcity/bt42_RUNNER_76
[10:54:34][Step 8/10] ##teamcity[publishArtifacts 'C:\TeamCity\buildAgent\temp\agentTmp\TUcUi6YjpZJlgpN1V44wTaX11CzkLXy5.nunit => .teamcity\bt42_RUNNER_76']
[10:54:34][Step 8/10] Process exited with code -4 (Step: Run unit tests release MeasurementProgram (NUnit))
[10:54:34][Step 8/10] Step Run unit tests release MeasurementProgram (NUnit) failed```
2

2 Answers

0
votes

It seems some of the extensions required by TeamCity aren't installed.

The easiest way is to install NUnit on TeamCity agents using Agent Tools (it automatically installs all necessary extensions).

But if you want to do it manually, you need to install additional extensions to your project. Please, check the related documentation page and this issue in YouTrack.

0
votes

The problem was solved by updating the NUnit.ConsoleRunner to version 3.10.0. As was suggested here https://github.com/nunit/nunit/issues/1525.