Build fails because it starts before its dependent

Hi, I have a build that regularly fails because it starts before its dependent build and its dependent artifacts are too old.

Here is my general setup :
VCS is subversion 1.5.5
TC is 4.0.2

My build configurations are :

  1. ProjectA
    • VCS trigger
    • Quiet period 60s
    • Produce artifacts
  2. ProjectB
  • VCS trigger
  • Quiet period 60s
  • Dependency trigger on ProjectA
  • Artifacts dependencies on ProjectA
  • Snapshot dependencies on ProjectA (optional)

A common scenario is someone do a commit in subversion that triggers both projects (let assume that changes are done in both projects in the same commit revision).
Now ProjectA need to be built first because ProjectB need its artifacts. For some unknown reason to me, ProjectB starts first and fails.
I have added a snapshot dependency for ProjectB but that didn't help. My configuration looks good to me and I suspect there is some TC mechanism I don't understand.

Any advise?

Comment actions Permalink

Your ProjectB should have a snapshot dependency on ProjectA is it true? How did you configure artifact dependencies? What artifacts do you use: last successful, last finished? If you need to take artifacts from the build with same sources you need to use "last finished" in the artifact dependencies.

Comment actions Permalink

Thanks Pavel for your reply.

ProjectB snapshot dependency on ProjectA is :
Do not run new build if there is a suitable one, Only use successful builds from suitable ones

ProjectB artifacts dependency on ProjectA is :
Last successful build, Clean directory before downloading artifacts

You're telling me that I should use "last finished"... I've always asked myself what is the difference between "last successful" and "last finished".
It's not cleared in the documentation (or I've missed a part). Can you explain me what will be the difference?

Comment actions Permalink

Last finished build is not always last successful build. Moreover if snapshot dependencies are used artifact dependency on a last finished build starts to behave a little different: TeamCity should take last finished build created from the same soruces.

For example, ProjectB has a snapshot dependency on a ProjectA, but there is a finished build in ProjectA which can be reused. If ProjectB needs some artifacts from ProjectA it is crucial to take them from the right build, because there can be more than one finished ProjectA build and some of these builds can have more changes than build of ProjectB (while ProjectB is waiting in the queue several builds of ProjectA were built).

Comment actions Permalink

After 2-3 months of testing with different versions of TC (4.0, 4.5, 4.5.2) in live environment, this is not working as expected when using a Quiet Period.

Bug was filled :


Please sign in to leave a comment.