Code review comment for lp:~mbp/launchpad/612171-diff-generation-spam

Revision history for this message
Martin Pool (mbp) wrote :

I think this now passes all its tests, but I'm being bitten by bug 871596 so I'm not sure. I'll try it on ec2.

I don't understand the comment on this test: specifically how it is checking jobs that have been waiting for a long period of time:

    def test_run_branches_not_ready(self):
        # If the job has been waiting for a significant period of time (15
        # minutes for now), we run the job anyway. The checkReady method
        # then raises and this is caught as a user error by the job system,
        # and as such sends an email to the error recipients, which for this
        # job is the merge proposal registrant.
        eric = self.factory.makePerson(name='eric', <email address hidden>')
        bmp = self.factory.makeBranchMergeProposal(registrant=eric)
        job = UpdatePreviewDiffJob.create(bmp)
        pop_notifications()
        JobRunner([job]).runAll()
        [email] = pop_notifications()
        self.assertEqual('Eric <email address hidden>', email['to'])
        self.assertEqual(
            'Launchpad error while generating the diff for a merge proposal',
            email['subject'])
        self.assertEqual(
            'Launchpad encountered an error during the following operation: '
            'generating the diff for a merge proposal. '
            'The source branch has no revisions.',
            email.get_payload(decode=True))

« Back to merge proposal