Merge lp:~adeuring/lazr.jobrunner/early-reference-to-job.fail-test into lp:lazr.jobrunner
| Status: | Merged |
|---|---|
| Approved by: | Aaron Bentley on 2012-03-26 |
| Approved revision: | 24 |
| Merged at revision: | 23 |
| Proposed branch: | lp:~adeuring/lazr.jobrunner/early-reference-to-job.fail-test |
| Merge into: | lp:lazr.jobrunner |
| Diff against target: |
161 lines (+81/-20) 2 files modified
src/lazr/jobrunner/jobrunner.py (+20/-19) src/lazr/jobrunner/tests/test_jobrunner.py (+61/-1) |
| To merge this branch: | bzr merge lp:~adeuring/lazr.jobrunner/early-reference-to-job.fail-test |
| Related bugs: |
| Reviewer | Review Type | Date Requested | Status |
|---|---|---|---|
| Aaron Bentley (community) | 2012-03-26 | Approve on 2012-03-26 | |
|
Review via email:
|
|||
Description of the Change
This branch adds a test to imitate the possible behavviour of Storm
based job instances: That accessing methods or other of the instance
may fail when a DB error occurred. The test uses the job class
VolatileAttribu
run() has been called.
I also noticed that JobRunner.run() left jobs in the status RUNNING,
if the methods suspend(), queue(), complete() fail. This can easily
happen, for example, when the method run() of a Storm based class seems
to succeed, but the call of transaction.
fails due to an IntegrityError.
Hence I reorganised the exception handling in JobRunner.run() a bit,
so that job.fail() is called when suspend(), queue(), complete()
raise an error.

Good catch.