nunit-console: Console runner fails - Unable to acquire remote process agent

@greg73 commented on Mon Jul 25 2016

Hi,

We have installed NUnit 3.4.1 on our build server (Windows 2008 R2) running Jenkins. Randomly the console runner fails to start with the following error. After an error, if the build is re-run manually the console runner works correctly without error.

The stack trace is

System.Exception: Unable to acquire remote process agent
   at NUnit.Engine.Runners.ProcessRunner.LoadPackage()
   at NUnit.Engine.Runners.AbstractTestRunner.Load()
   at NUnit.Engine.Runners.AggregatingTestRunner.LoadPackage()
   at NUnit.Engine.Runners.AbstractTestRunner.Load()
   at NUnit.Engine.Runners.MasterTestRunner.LoadPackage()
   at NUnit.Engine.Runners.AbstractTestRunner.EnsurePackageIsLoaded()
   at NUnit.Engine.Runners.MasterTestRunner.NUnit.Engine.ITestRunner.Run(ITestEventListener listener, TestFilter filter)
   at NUnit.ConsoleRunner.ConsoleRunner.RunTests(TestPackage package, TestFilter filter)
   at NUnit.ConsoleRunner.Program.Main(String[] args)

The command line we are using is

"C:\Program Files (x86)\NUnit.org\nunit-console\nunit3-console.exe" [paths to test dlls] --result:nunit-result.xml;format=nunit2

Thanks


@greg73 commented on Tue Jul 26 2016

I have now confirmed that the same error occurs when running from the command prompt. Immediately re-entering the same command results in the tests running successfully.


@CharliePoole commented on Sun Aug 07 2016

The only answer I can see is that the process runner times out. Are you using a large number of test assemblies?


@greg73 commented on Mon Aug 08 2016

No, this is quite a small project, only 3 test assemblies


@MistyKuu commented on Thu Aug 11 2016

Having the same issue on TeamCity


@rprouse commented on Mon Oct 24 2016

@greg73 and @MistyKuu, we will need more information to move forward with this issue.


@greg73 commented on Tue Oct 25 2016

@rprouse The error is not reproducible, i.e. it will happen once and then when immediately running the same tests again the error won’t happen. I think it may be related to available memory, if the server is swapping memory and the build is running slowly the error seems more likely to happen.


@CharliePoole commented on Tue Oct 25 2016

Not sure if we will be able to fix this, but moving it to the right project anyway. 😄

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Reactions: 1
  • Comments: 36 (14 by maintainers)

Most upvoted comments

@muellnes Those options are contradictory and don’t use any agents at all. The --inprocess option means “run in process, rather than creating agents” and the --agents option is ignored.

You may be right. For anyone coming along afterwards, I did find what appears to be a viable work-around. The maximum test agents had been left at the default (unlimited) value. Adjusting that value down to something smaller (I chose 3, but based on the log file my machine may be able to support as many as 8) eliminated the error while still allowing all the tests to run. It just didn’t run as many of the tests in parallel.