TFS 2010: wrong build agent selected

I have two configured build agents on one controller:

  • Default agent
  • Default agent

I defined an assembly definition with the following agent settings:

Maximum Agent Execution Time: 00:00:00 Maximum Agent Reservation Wait Time: 04:00:00 Name Filter: Default Agent Tag Comparison Operator: MatchExactly Tags Filter: 

I created several BuildInformation Activities after the GetAgent action.

  • String.Format("Build Agentname: {0}", BuildAgent.Name)
  • String.Format("AgentSettingsName: {0}; AgentSettingsTags: {1}", AgentSettings.Name, String.Join(",", AgentSettings.Tags))

Exit:

 AgentScope (reserved build agent Default Agent1) Build Agentname: Default Agent1 AgentSettingsName: Default Agent; AgentSettingsTags: 

Therefore, the AgentSettings.Name argument is AgentSettings.Name to "Default Agent," but, paradoxically, the "Default Agent 1" is used.

Workflow: enter image description here

It is strange that sometimes the correct build agent is selected.

This is mistake? What is my mistake?

It would be nice if someone could reproduce this behavior too.

EDIT:

I created an error message: https://connect.microsoft.com/VisualStudio/feedback/details/725885/tfs-2010-wrong-build-agent-is-choosen

+4
source share
2 answers

It definitely sounds like an error if you are using AgentScope activity. Are you logged in to Microsoft Connect ?

Make sure you are using AgentScope and not GetBuildAgent . I could not say which one you referred to. An AgentScope operation is one that actually reserves the agent based on the parameters of the agent reservation specification parameter that you specify.

+2
source

When we provide Name Filter = Default Agent . He accepts any agent available and ongoing with this agent. If you want to select a specific agent, you can use the simple assignment action immediately after receiving the assembly agent to select a specific assembly agent, as shown below.

agentsettings.name = "Agent Name".

This will allow you to select the build agent for which you want to complete this task.

OR

In the build agent, you can use the tag functionality and use agentettings.hastags .

0
source

Source: https://habr.com/ru/post/1397435/


All Articles