Running build picks up pending files?

We notice in our TeamCity setup that when TC starts building it still picks up pending changes after it started running the build...

This results in a difference in SVN revision number between what TC reports and what is actually being built.

Has anyone noticed this before? Does anyone know what could cause this?

12 comments
Comment actions Permalink

Hello Jeroen,

  When TeamCity build starts, there is a "collecting changes" phase. During this phase, Teamcity collects changes for the build (in typical case, unless quiet period is set).
  At the end of the phase, corresponding latest SVN revisions are fixed and build changes are determinated.

  After that, TeamCity always checks out changes up to detected SVN revisions to ensure that only the detected changes go to the build.

  So this is how it must work. If in your case the behaviour is different, please describe in detail what's going on in your case.

  Kind regards,
  KIR

0
Comment actions Permalink

Well I don't really know how long the "collecting changes" phase takes. Is it a matter of seconds? Or can it happen over a period of 15 minutes or so...
All I know is that pending changes seem to be taken up in the builds that are running. I don't really know until "when" exactly they are being picked up, maybe until 5 minutes after the build starts, or 15, or 20... No idea.

I'm not sure how I can describe in detail what is happening. A build is started, a file is checked in, is shown under "Pending", but ends up in the build that's running. This is with TC 5.0 EAP, but we've noticed it with 4.5.4 as well. I'd love to help, so if you can tell me what exactly I can do to provide more information, I will.

0
Comment actions Permalink

Hello,

  The checking for changes phase may take minutes on a large SVN repository.

  The phase is indicated by "Checking for changes" text in build status line.

  You can disable checking for changes phase entirely by enabling quiet period, but this will result in increased number of builds.

  Regards,
  KIR

0
Comment actions Permalink

More information... I think we've found the cause.

Our repository was at version 5482 when TC started building.
We saw the agent's work directory update to the latest svn, according to svn info of /data/teamcity/agent/work/49d0ec14dabac466/
Right after the build had started I changed a file and checked it in.

After the build we see that the SVN version in our application is 5485, higher than when TC started its build.
The agent's work directory (which is what gets built, right?) should not be svn updating anything anymore until the next build is triggered.
Still, when asking for svn info from the dir in which I changed a file it said:

Repository UUID: 8c4598bd-45a0-4aa0-9333-8befb201a2c8
Revision: 5485
Node Kind: directory
Schedule: normal
Last Changed Author: JB
Last Changed Rev: 5483



In short: 5482 is when the build was triggered, 5483 is my checkin after the build started (apparantly to more files were changed after I checked in because we ended up with 5485).

Does this explain it?
0
Comment actions Permalink

Hello,

  And which version is indicated on the Changes tab of the build?
  Another question is do you see change 5483 on the Changes ?

  Regards,
  KIR

0
Comment actions Permalink

I've attached the screenshot of what I think is what you mean by "Changes tab"

No, it does not report any changes after 5482



Attachment(s):
Changes.png
0
Comment actions Permalink

Hi Jeroen,

   It looks like a really serious bug, and I hope it isn't .
  Which version of TeamCity do you use?

  Are you sure your build doesn't run 'svn update' on its own after the start? Can you attach the build log?

  Are there chances that another build was run on the same agent after given one?

  The revision information I was looking for is in expandable block "VCS revisions and labels" at the top of the Changes page.

  Kind regards,
  KIR

0
Comment actions Permalink

Hello Kirill,

It looks like a rather serious bug to us too

I've attached the same screenshot, but now with the VCS section expanded. The build log is there too.

We only have 1 build agent currently, 2 branches (projects in TC) on which active development takes place. I can assure you no other build has been running. An agent can only build one project at the time, can't it?

We're running on TeamCity 5.0 EAP 10522, but we're fairly sure we saw it with the previous version 4.5.4 as well.
I'm rather sure we don't run svn udpate in the /data/teamcity/agent/work/49d0ec14... directory

Greeting,

Jeroen.



Attachment(s):
Luma_Luma_1.6.x_maintenance_5482.log.zip
Changes2.png
0
Comment actions Permalink

Hello,

  I've found the following line in your build log:

Executing: /bin/sh -c cd /data/teamcity/agent/work/49d0ec14dabac466 && svn --non-interactive update /data/teamcity/agent/work/49d0ec14dabac466

  I believe this is it.

  Or not?

  Regards,
  KIR

0
Comment actions Permalink

That certainly updates the sources.
If it's not coming from TeamCity I'll have to check whether it's coming from maven.
I hope it's us doing this.

Greeting,

Jeroen.

0
Comment actions Permalink

Sorry for all the confusion, it was our Maven build system which updated the subversion files.

Good news is it wasn't in TeamCity. So you can safely release version 5.0 now

Spasibo bolsjoj, Kirill. Ochen ochen

0
Comment actions Permalink

You're welcome
My hopes came true in this case.

0

Please sign in to leave a comment.