What property indicates a build is complete?

Hi,

I am using Continuous Integration web service from MSDN article - http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnvs05/html/ConIntTmFndBld.asp

It works great as long as check-ins on same project don't happen while a build is running. In this case, a second build gets logically queued but it fires off before the previous build is actually complete. The exception thrown is:

4/21/2006 2:23:06 PM: Building again for checkins during this build: Team Project: AntibodyServices, Build Type: Lifespan.Antibody.Services_Integration_Build
4/21/2006 2:23:07 PM: Error: System.Web.Services.Protocols.SoapException: TF42045: A build for the team project: AntibodyServices is in progress on build machine: foundation01. On each build machine, only one build can be active for each team project. Use a different build machine or try again later.
at Microsoft.TeamFoundation.Build.Server.BuildController.StartBuild(BuildParameters buildParameters), at System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse(SoapClientMessage message, WebResponse response, Stream responseStream, Boolean asyncCall)
at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object[] parameters)
at Microsoft.TeamFoundation.Build.Proxy.BuildController.StartBuild(BuildParameters buildParameters)
at NotificationService.CallBuild(Object state)

Build completion is defined in this code as:

Proxy.BuildData bd = store.GetBuildDetails( buildUri );

BuildConstants.BuildStatusIconID status = (BuildConstants.BuildStatusIconID) bd.BuildStatusId;

buildComplete = ( status == BuildConstants.BuildStatusIconID.BuildSucceeded ||
status == BuildConstants.BuildStatusIconID.BuildFailed ||
status == BuildConstants.BuildStatusIconID.BuildStopped ) && ( bd.FinishTime.Year > 1 );

Is there some other property that is a better indicator of build completion that I can interrogate instead?

Thanks,
Luke

[1986 byte] By [Surly] at [2008-2-18]
# 1

The condition you are using to check buildcompletion is correct. In fact the Finishtime check itself is enough indication. Can you try giving a few seconds delay before kicking off the second build and see if that works.

Chaitanya

ccheruvu at 2007-9-9 > top of Msdn Tech,Visual Studio Team System,Team Foundation Server - Build Automation...

Visual Studio Team System

Site Classified