Your browser was unable to load all of the resources. They may
have been blocked by your firewall, proxy or browser configuration.
Press Ctrl+F5 or Ctrl+Shift+R to have your browser try again.
I want to schedule a build to run if the configuration is not already running, (to be used in combination with a repository changes condition).
Im trying to use a groovy script to check for a running build but i seem to be getting strange results
// check if there is already a running build:
Build latest = configuration.getLatestBuild();
if(latest != null)
{
logger.info("found build["+latest.getId()+"] " + latest.getStatus());
if(latest.getStatus() != Build.Status.RUNNING )
{
return true;
}
}
return false;
This never returns true. Interestingly if i negate the comparison (latest.getStatus() == Build.Status.RUNNING) It will continue to queue builds if the configuration is running (as expected), but once the initial builds completes, all the queued builds disappear.
Can you explain what is happening here? Also is there a way to see the output from my condition script?
Thanks,
jstutesman
-
replies
3
-
views
1935
-
stars
0
-
If run mode of the configuration is set to sequential, QuickBuild will process build request one by one. So if build is scheduled to run frequently, many build requests may pile in the queue, and they can only be processed (including build condition evaluation) after previous request is processed, and this means that the latest build is always finished. This is the reason why you see the build condition always returning true.
To solve the problem, you may run set run mode of the configuration to concurrent, so that build condition evaluation can be done while current build is running.
Further, if your purpose is to reduce number of unnecessary scheduled builds, you may set queue of the configuration to aggregate build requests, while still remain the run mode as sequential.
Also output of the condition evaluation script is contained in system log as at this time, build for current request is not generated yet.
Thanks for the info Robin, but im still having some trouble getting the correct behavior.
Setting the run mode to concurrent in combination with my script works as long as there are less request's than workers in the queue. As soon as the queue starts holding up the builds I have the same problem again.
Setting the queue to aggregate build requests doesn't seem to work either. With a simple configuration set to run every 1 second which sleeps for 10 seconds, I will see 10 builds pile up in the queue. Then when one finishes all the queued requests will disappear and the new build will start running. If i'm understanding the aggregate builds feature correctly it should combine all the queued requests into a single request, so at most i should see 1 running and 1 queued.
This is still not ideal for continuous integration as any time a build is running it will always queue another build, since it hasn't evaluated the build condition yet. It should only queue another build if there are changes in the repository. Perhaps we need a Queue Condition to be evaluated before a build is added to the queue?
Thanks,
jstutesman
You are right on queue aggregation behavior. QuickBuild should only keep one build waiting in the queue. An improvement request is created as: http://track.pmease.com/browse/QB-723
Queue aggregation in current version still works except that you will see build requests being piled and most of them will be aggregated when next build starts.