Spawn multiple processes from build agent

Hi,

We use TeamCity to run our acceptance tests from a command line application.  TeamCity simple has a build step to run a .Net executable which in turn will run a command line utility for each test.  Previously this was done sequentially, i.e. a process would be launched to run the test and the master process would wait for each one to finish before continuing to the next one.  However to try and improve the efficiency of this I've wrapped this in a parallel.ForEach so multiple tests can be run at once.  Locally this runs absolutely fine with lots of console windows popping up.  However when run in the TeamCity build agent all but one of the processes that are launched in parallel end up hanging.  When run through the TeamCity agent this is all in a windows service so its very hard to find out what is actually going on.

The processes are all launched using the Process.Start .Net api and calling WaitForExit.

Does anyone have any suggestions as to what might be going on or any potential workarounds?

Matthew

2 comments
Comment actions Permalink

Hi,

You can run TeamCity agent not as service via console using  <installation path>\bin\agent.bat start script, see this section.
Have you tried to run the same build on the same machine as the TeamCity agent and under the same user that the agent (steps are described here)?

0
Comment actions Permalink

Alina,

Thank you for the response.  I've tried just running it locally on the TeamCity agent outside of the service and I can see the problem now.  It is unrelated to TeamCity and is the setup of my scripts

Thanks again,

Matthew

0

Please sign in to leave a comment.