Round robin agent selection?

Is there any way to select the agents in a round robin fashion?

We have 3 agents on Linux, Windows and Mac, in addition to an agent on the central server, which also runs on Linux.  It seems like the Linux agent is the "goto" agent.  Is this because it is listed first among the agents?

One time, our main application were built more 50 times in a row by the Linux agent.  Then, a test on the Windows agent failed due to a commit that was done pretty early on in the run of those 50 builds, which triggered an environment bug.  Is there a way to spread the agent selection around, like setting up a round robin scheme, or something like that?

sincerely Yours,
Jørgen Sivesind

6 comments
Comment actions Permalink

Teamcity tries to select the agent which it thinks will run the build faster. If there are 3 agents and they are always free, the fastest one will always run the build. To build against different environment, you need to have separate build configurations or manually choose an agent to run a build on.

0
Comment actions Permalink

Ok.  Good to know, but not really helpful.  The Linux agent is the fastest agent, so that explains why it pretty much allways gets the assignment.  So far, our solution have been to run it manually, but I guess we will set up two extra build configurations to run the build at least once a day, on the Mac and Windows machines, to make sure tests don't fail in those environments.

May I ask a feature request?  Some kind of agent preference selection, like "fastest available agent", "round robin" and maybe "random".  At least if we had such an option, it would save us those 2 extra build configurations on most of our projects.

0
Comment actions Permalink

I think we are not going to allow random (round-robin) agent selection, unless you write your own plugin which enables this functionality.

As you correctly mentioned, you need to create additional build configuration and create at least a schedule trigger to run build at a certain schedule. However, the best way would be to run builds against all three environments all the time, not just once a day. This is what we at Teamcity do. To find out how to do this, please read about snapshot dependencies: https://confluence.jetbrains.com/display/TCD9/Snapshot+Dependencies

0
Comment actions Permalink

Ok.  We allready have an extensive dependency tree with a UI-testing project and some plugin-projects that depend on the main project, so it does get a little complicated when we have to factor in the OS as well, but we will figure out a way of doing it.

Thanks.

0
Comment actions Permalink

It's pretty easy if you setup a proper agent requirements, for example, "teamcity.agent.jvm.os.name contains Windows"

0
Comment actions Permalink

Yeah, I know.  :)
We do have some set-up like that.  The complicated part is thinking through our project tree, and design a good dependency structure that does not block all the agents at the same time, for a long time.  I still think a round-robin scheme would be the best solution for us, but we'll find other ways of solving this as well.

0

Please sign in to leave a comment.