Merge lp:~le-chi-thu/lava-dispatcher/rapport-result-submit-failures into lp:lava-dispatcher

Proposed by Le Chi Thu
Status: Merged
Merged at revision: 304
Proposed branch: lp:~le-chi-thu/lava-dispatcher/rapport-result-submit-failures
Merge into: lp:lava-dispatcher
Diff against target: 34 lines (+7/-3)
1 file modified
lava_dispatcher/job.py (+7/-3)
To merge this branch: bzr merge lp:~le-chi-thu/lava-dispatcher/rapport-result-submit-failures
Reviewer Review Type Date Requested Status
Michael Hudson-Doyle (community) Approve
Review via email: mp+104353@code.launchpad.net

Description of the change

When the dispatcher fail to submit the test result, the error was not handle correctly and there is not logging so the summary page did not tell why the job not complete.

http://validation.linaro.org/lava-server/scheduler/job/17614

See the current error msg here.
http://validation.linaro.org/lava-server/scheduler/job/17614/log_file#entry26

To post a comment you must log in.
280. By Le Chi Thu <email address hidden> <email address hidden>

Synched with trunk and fix a typo error

Revision history for this message
Michael Hudson-Doyle (mwhudson) wrote :

Huh, missed this. Sorry about that. Seems fine, I'll merge it -- with one tweak: I don't think we should trap the exception from submit_job, because we still want the dispatcher to exit with code 1 if the submit action fails.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'lava_dispatcher/job.py'
2--- lava_dispatcher/job.py 2012-05-08 22:03:24 +0000
3+++ lava_dispatcher/job.py 2012-05-10 20:04:22 +0000
4@@ -85,7 +85,7 @@
5 'items': {'type': 'string'},
6 'optional': True,
7 },
8- },
9+ },
10 }
11
12
13@@ -143,7 +143,7 @@
14 if 'device_type' in self.job_data:
15 metadata['target.device_type'] = self.job_data['device_type']
16 self.context.test_data.add_metadata(metadata)
17-
18+
19 self.context.test_data.add_tags(self.tags)
20
21 try:
22@@ -190,7 +190,11 @@
23 params = submit_results.get('parameters', {})
24 action = lava_commands[submit_results['command']](
25 self.context)
26- action.run(**params)
27+ try:
28+ logging.info("Submiting the test result with parameters = %s", params)
29+ action.run(**params)
30+ except Exception as err:
31+ logging.error("Failed to submit the test result. Error = %s", err)
32
33 def _set_logging_level(self):
34 # set logging level is optional

Subscribers

People subscribed via source and target branches