← Back to team overview

launchpad-reviewers team mailing list archive

[Merge] lp:~julian-edwards/launchpad/date-finished-bug-699820 into lp:launchpad

 

Julian Edwards has proposed merging lp:~julian-edwards/launchpad/date-finished-bug-699820 into lp:launchpad.

Requested reviews:
  Launchpad code reviewers (launchpad-reviewers)

For more details, see:
https://code.launchpad.net/~julian-edwards/launchpad/date-finished-bug-699820/+merge/45866

Prevent the upload processor from changing date_finished on the build_farm_job, because the buildd-manager will have already set it.

It needs to be set in the buildd-manager so we can accurately see the overhead that the upload processor incurs.


-- 
https://code.launchpad.net/~julian-edwards/launchpad/date-finished-bug-699820/+merge/45866
Your team Launchpad code reviewers is requested to review the proposed merge of lp:~julian-edwards/launchpad/date-finished-bug-699820 into lp:launchpad.
=== modified file 'lib/lp/archiveuploader/uploadprocessor.py'
--- lib/lp/archiveuploader/uploadprocessor.py	2010-12-22 02:05:37 +0000
+++ lib/lp/archiveuploader/uploadprocessor.py	2011-01-11 15:34:56 +0000
@@ -249,7 +249,6 @@
             UploadStatusEnum.FAILED: "failed",
             UploadStatusEnum.REJECTED: "rejected",
             UploadStatusEnum.ACCEPTED: "accepted"}[result]
-        build.date_finished = datetime.datetime.now(pytz.UTC)
         if not (result == UploadStatusEnum.ACCEPTED and
                 build.verifySuccessfulUpload() and
                 build.status == BuildStatus.FULLYBUILT):

=== modified file 'lib/lp/soyuz/tests/test_binarypackagebuild.py'
--- lib/lp/soyuz/tests/test_binarypackagebuild.py	2010-11-12 12:32:48 +0000
+++ lib/lp/soyuz/tests/test_binarypackagebuild.py	2011-01-11 15:34:56 +0000
@@ -437,7 +437,6 @@
         self.assertIsNot(None, self.build.log)
         self.assertEqual(self.builder, self.build.builder)
         self.assertEqual(u'somepackage', self.build.dependencies)
-        self.assertIsNot(None, self.build.date_finished)
 
     def testWithoutDependencies(self):
         """Verify that storeBuildInfo clears the build's dependencies."""
@@ -450,6 +449,12 @@
         self.assertIs(None, self.build.dependencies)
         self.assertIsNot(None, self.build.date_finished)
 
+    def test_sets_date_finished(self):
+        # storeBuildInfo should set date_finished on the BuildFarmJob.
+        self.assertIs(None, self.build.date_finished)
+        self.build.storeBuildInfo(self.build, None, {})
+        self.assertIsNot(None, self.build.date_finished)
+
 
 class MakeBinaryPackageBuildMixin:
     """Provide the makeBuild method returning a queud build."""


Follow ups