Merge ~cjwatson/launchpad:fix-stormify-branchjob into launchpad:master

Proposed by Colin Watson
Status: Merged
Approved by: Colin Watson
Approved revision: 51f776ac96ca07340c4e632839af2c8ee0524574
Merge reported by: Otto Co-Pilot
Merged at revision: not available
Proposed branch: ~cjwatson/launchpad:fix-stormify-branchjob
Merge into: launchpad:master
Diff against target: 20 lines (+2/-0)
1 file modified
lib/lp/services/job/tests/test_celeryjob.py (+2/-0)
Reviewer Review Type Date Requested Status
Tom Wardill (community) Approve
Review via email: mp+381172@code.launchpad.net

Commit message

Fix TestRunMissingJobs.test_find_missing_ready

Description of the change

After converting BranchJob to Storm, we need to flush database caches before we can read back the job.id serial column.

This fixes a test failure on buildbot.

To post a comment you must log in.
Revision history for this message
Tom Wardill (twom) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/lib/lp/services/job/tests/test_celeryjob.py b/lib/lp/services/job/tests/test_celeryjob.py
2index 08cac72..d1991c1 100644
3--- a/lib/lp/services/job/tests/test_celeryjob.py
4+++ b/lib/lp/services/job/tests/test_celeryjob.py
5@@ -11,6 +11,7 @@ from testtools.content_type import UTF8_TEXT
6
7 from lp.code.model.branchjob import BranchScanJob
8 from lp.scripts.helpers import TransactionFreeOperation
9+from lp.services.database.sqlbase import flush_database_updates
10 from lp.services.features.testing import FeatureFixture
11 from lp.services.job.tests import (
12 celery_worker,
13@@ -76,6 +77,7 @@ class TestRunMissingJobs(TestCaseWithFactory):
14 def test_find_missing_ready(self):
15 """A job which is ready but not queued is "missing"."""
16 job = self.createMissingJob()
17+ flush_database_updates()
18 self.addTextDetail(
19 'job_info', 'job.id: %d, job.job_id: %d' % (job.id, job.job_id))
20 find_missing_ready_obj = self.getFMR(BranchScanJob, 0)

Subscribers

People subscribed via source and target branches

to status/vote changes: