0

In TeamCity, I have two build configurations: Build A and Build B. Build B has a snapshot dependency on Build A and is set to trigger via a finish build trigger when Build A completes.

When I trigger 5 builds numbers in build A I expected for each when its finished to trigger build B.

Here’s the scenario:

  1. I triggered 4 builds for Build A. These builds are scheduled to run on Agent X. At any given time, one build is running, and the remaining three are queued.
  2. Build B is also configured to run on Agent X.
  3. When the first instance of Build A finishes, it correctly triggers Build B. Build B is then queued because the next instance of Build A starts running immediately.
  4. The issue arises here: when the second instance of Build A finishes, I expect it to trigger another instance of Build B, resulting in two builds queued for Build B. However, I only see one queued build for Build B, not two.
  5. This pattern continues, and in the end, only one instance of Build B runs, despite triggering four instances of Build A. I expected all four instances of Build A to pass through Build B.

The VCS root is connected only to check out the latest code from a branch.

I do see that Build B is triggered after Build A finishes, but not consistently for each instance as expected.

1 Answer 1

0

AFAIR, this is the expected behavior of snapshot dependencies - the idea is that if there were no new changes in the VCS or build A parameters, then there's no sense in running a new build B wasting the build time and executor resources.

A key difference of TeamCity is that you define the desired state of the builds by running the latest build in the build chain, not the first one.

I'd suggest to rethink your approach and only trigger the build configuration B, if possible - if your Do not run new build if there is a suitable one setting is disabled, you should be able to get the desired result.

Also, I suppose that actually removing the snapshot dependency relation might work - but it would be up to you to decide if this is acceptable for your case.

P.S. TeamCity documentation has always been a bit hard to understand in some parts, so you might really want to reread it for like 2-3 times to finally get the logics - at least that's what worked for me back in the days I used TC on a daily basis.

Sign up to request clarification or add additional context in comments.

2 Comments

I use the TeamCity REST API in a Python application to trigger build A multiple times with a 30-second delay between each trigger. I've noticed that triggering build A four times ensures build B is triggered each time. However, when triggering build A five times, only four builds trigger build B. I suspect this is due to TeamCity's default 60-second scan interval. How can I ensure that each build A consistently triggers build B, regardless of the number of builds triggered?
I believe there's a setting called "quiet period" or something like that, maybe this helps

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.