TFS agent-side checkout issue
Hi,
while using agent-side checkout with TFS I noticed a strange behavior. After the first clean get I'd expect TC to update the workspace doing a "Get Latest", while instead it looks like it's trying to get all files from VCS.
I'm saying this because it takes the same amount of time doing a clean get and a successive get and furthermore monitoring the tfs-native process I notice it's doing a lot of work in a temporary directory and in addition on the workspace.
Please sign in to leave a comment.
In case it's useful, here's the log from the agent during an incremental get which should take only a few seconds:
Any help on this one?
How many VCS root were used for the build configuration?
Do you run build agent and server on the same machine?
Does build agent TFS user account allowed to create TFS workspaces? Is that possible to create TFS workspace in the build checkout directory? Do you use default build checkout directory?
Please attach a dump of all TFS worcpaces on the machine with name containng TeamCity.
Thanks, sorry for delay!
1
No, different machines
3 Yeses. The workspace is created correctly, and it's populated correctly and the build runs successfully. The only problem I notice is on subsequent gets from VCS where they seem not to update the workspace but instead get all the files once again. Note however that the checkout directory (which is the same as the workspace) is not "cleaned and filled from scratch" just like it would happen on a clean checkout, instead the impression is that the TFS client is simply going over all files once again.
As a side note, if I log into the agent machine and open up an instance of VS running with the credentials of the agent service user (which is the same used to connect to TFS) - thus effectively being able to access the TC workspace - then doing a "get latest" operation is as fast as it's supposed to be, about a couple of seconds.
Ho do I do this?
No problem
What Tfs is doing to update working copy are:
- refresh workspace
- revert all pending changes
- do update
Probably one of mentioned operations works faster if VS is running.
Do you use checkout rules? Please attach rules.
What does it mean to "refresh the workspace"?
There should not be any pending changes on th workspace so I don't think it should be talking long.
The update itself should take only a few seconds, since we are tyring it out and usually there are no changes on the VCS.
Note that when I said that from VS it's faster I mean doing that FROM Visual Studio, not from TeamCity while VS is running.
No checkout rules as per the docs which say that they are not performant when checking out on the agent side.
I found the bug. I'll attach you a patch as the result.
Thanks, I'll be waiting for the patch. Please take into account that we're running 5.0.2, not yet upgraded to 5.0.3, in case it makes any difference.
I've added an issue for you at
http://youtrack.jetbrains.net/issue/TW-11601
BTW. Not TFS implentation on agent performs TFS update to a version with overwrite of all files. The fix will start performing update only for changed files (i.e. TFS Get Latest Version command)
Please watch or vote for the issue. I'll attach a patch there.
Thanks Eugene, great support.