Have you enabled the "block when upstream/downstream is running" options in the advanced section of the job config.
As this will normally keep multiple jobs in a chain, only allowing a single job to be running at a time. I have used these options to run a chain of 5-6 jobs run on multiple slaves, where the SCM needed to be kept at a particular point through the life of all jobs, and had no real issues. And there was no use of locks and latches at all. Chris. On Saturday, November 10, 2012 3:11:12 AM UTC, Russ Tremain wrote: > > One trick I have used is to set up a separate queue for the test job and > constrain it to run only one job at a time. > > You do this by creating a slave on the same machine and assign the test > job to it. > > You still might need to use locks & latches if you are running the build & > test jobs in the same workspace, otherwise not. > > At 5:01 PM -0800 11/9/12, Benjamin Lau wrote: > >So I've got 2 jobs > >build > >test > > > >What I want to be able to do is make sure that they always run in this > order and that text blocks build from running and build blocks test from > running. I was able to accomplish that using the Locks and Latches plugin. > The problem I'm running into is this... > > > >If I start a build (build 1) and then I queue another build (build 2) > both of these complete before test is executed. The behavior I want if for > build 1 to complete and test to run, then build 2 is run and test is run > again. I tried playing around with the quiet period for build, but that > seems to be counted when the job is in the queue not just after it's about > to start. > > > >I could combine the two jobs... but I'd like to be able to continue to > execute these independently when I need since I might want to fix tests and > run them against the same build repeatedly. > > > >Thanks in advance, > > > >Ben > >