Merge lp:~michael.nelson/launchpad/527617_aborted_build_job into lp:launchpad

Proposed by Michael Nelson
Status: Merged
Approved by: Graham Binns
Approved revision: no longer in the source branch.
Merged at revision: not available
Proposed branch: lp:~michael.nelson/launchpad/527617_aborted_build_job
Merge into: lp:launchpad
Diff against target: 31 lines (+4/-2)
2 files modified
lib/lp/buildmaster/model/packagebuildfarmjob.py (+1/-1)
lib/lp/soyuz/doc/buildd-slavescanner.txt (+3/-1)
To merge this branch: bzr merge lp:~michael.nelson/launchpad/527617_aborted_build_job
Reviewer Review Type Date Requested Status
Graham Binns (community) code Approve
Review via email: mp+20968@code.launchpad.net

Commit message

Aborting a build job sets the buildstate to NEEDSBUILD rather than BUILDING.

Description of the change

This simple fix ensures that when a build job is aborted, the buildstate of the build is set to NEEDSBUILD.

The documentation test always stated: "ABORTED -> builder was aborted, release builder and reset job for the next build round", but the state of the actual build was never included in the test.

This bug seems to be the cause of bug 499421 and bug 527617.

I tried to chase this change back to find where it was introduced, but it goes way back past 2006 (being moved from one file to the next in various refactorings, I stopped at `bzr diff -c 3691.93.27`).

To test:
bin/test -t doc/buildd-slavescanner.txt

To post a comment you must log in.
Revision history for this message
Graham Binns (gmb) wrote :

Approved, with the reviewer agog at the simplicity.

review: Approve (code)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'lib/lp/buildmaster/model/packagebuildfarmjob.py'
2--- lib/lp/buildmaster/model/packagebuildfarmjob.py 2010-01-20 04:14:23 +0000
3+++ lib/lp/buildmaster/model/packagebuildfarmjob.py 2010-03-09 15:13:25 +0000
4@@ -27,4 +27,4 @@
5
6 def jobAborted(self):
7 """See `IBuildFarmJob`."""
8- self.build.buildstate = BuildStatus.BUILDING
9+ self.build.buildstate = BuildStatus.NEEDSBUILD
10
11=== modified file 'lib/lp/soyuz/doc/buildd-slavescanner.txt'
12--- lib/lp/soyuz/doc/buildd-slavescanner.txt 2010-03-08 17:43:41 +0000
13+++ lib/lp/soyuz/doc/buildd-slavescanner.txt 2010-03-09 15:13:25 +0000
14@@ -404,6 +404,8 @@
15 >>> a_builder.updateBuild(bqItem8)
16 >>> bqItem8.builder is None
17 True
18+ >>> print bqItem8.specific_job.build.buildstate.name
19+ NEEDSBUILD
20
21 Cleanup in preparation for the next test:
22
23@@ -496,7 +498,7 @@
24 ...
25 X-Launchpad-Build-State: FAILEDTOUPLOAD
26 ...
27- * Build Log: http://launchpad.dev/.../buildlog_ubuntu-hoary-i386.mozilla-firefox_0.9_BUILDING.txt.gz
28+ * Build Log: http://.../...i386.mozilla-firefox_0.9_NEEDSBUILD.txt.gz
29 ...
30 Upload log:
31 INFO creating lockfile