Merge lp:~abentley/launchpad/better-find-missing-ready-error into lp:launchpad

Proposed by Aaron Bentley on 2012-08-01
Status: Merged
Merged at revision: 15731
Proposed branch: lp:~abentley/launchpad/better-find-missing-ready-error
Merge into: lp:launchpad
Diff against target: 20 lines (+9/-1)
1 file modified
lib/lp/services/job/tests/test_celeryjob.py (+9/-1)
To merge this branch: bzr merge lp:~abentley/launchpad/better-find-missing-ready-error
Reviewer Review Type Date Requested Status
Raphaël Badin (community) 2012-08-01 Approve on 2012-08-01
Francesco Banconi (community) code* 2012-08-01 Approve on 2012-08-01
Review via email: mp+117669@code.launchpad.net

Commit Message

Add detailed failure output to test_find_missing_ready.

Description of the Change

= Summary =
Add detailed failure output to test_find_missing_ready, so that we can diagnose the cause of its intermittent failures.

== Proposed fix ==
Because we cannot reproduce the bug outside of buildbot, leave test_find_missing_ready active, but add more diagnostics so that we can understand the cause of the problem.

== Pre-implementation notes ==
Discussed with deryck

== LOC Rationale ==
I have a LOC credit of 1928

== Implementation details ==
None

== Tests ==
bin/test -t test_find_missing_ready

== Demo and Q/A ==
None

= Launchpad lint =

Checking for conflicts and issues in changed files.

Linting changed files:
  lib/lp/services/job/tests/test_celeryjob.py

To post a comment you must log in.
Francesco Banconi (frankban) wrote :

Looks good, thank you.
As said on IRC, please add an XXX that points to the bug we are trying to diagnose.

review: Approve (code*)
Raphaël Badin (rvb) wrote :

Looks good, have fun with the debugging ;).

fwiw, we use fixture's self.addDetail a lot in MAAS, very useful to debug intermittent failures.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'lib/lp/services/job/tests/test_celeryjob.py'
2--- lib/lp/services/job/tests/test_celeryjob.py 2012-07-30 19:07:47 +0000
3+++ lib/lp/services/job/tests/test_celeryjob.py 2012-08-01 15:12:09 +0000
4@@ -62,7 +62,15 @@
5 job.runViaCelery()
6 self.assertQueueSize(self.CeleryRunJob.app,
7 [BranchScanJob.task_queue], 1)
8- self.assertEqual([], self.find_missing_ready(BranchScanJob))
9+ #self.assertEqual([], self.find_missing_ready(BranchScanJob))
10+ # XXX AaronBentley: 2012-08-01 bug=1031018: Extra diagnostic info to
11+ # help diagnose this hard-to-reproduce failure.
12+ if self.find_missing_ready(BranchScanJob) != []:
13+ from lazr.jobrunner.celerytask import list_queued
14+ contents = list_queued(
15+ self.CeleryRunJob.app, [BranchScanJob.task_queue])
16+ self.fail('queue: %r, job.id: %d, job.job_id: %d' %
17+ (contents, job.id, job.job_id))
18 drain_celery_queues()
19 self.assertQueueSize(self.CeleryRunJob.app,
20 [BranchScanJob.task_queue], 0)