Merge lp:~le-chi-thu/lava-dispatcher/skip-home-screen-hcj into lp:lava-dispatcher

Proposed by Le Chi Thu
Status: Merged
Approved by: Michael Hudson-Doyle
Approved revision: 296
Merged at revision: 298
Proposed branch: lp:~le-chi-thu/lava-dispatcher/skip-home-screen-hcj
Merge into: lp:lava-dispatcher
Diff against target: 49 lines (+19/-2)
2 files modified
doc/changes.rst (+2/-0)
lava_dispatcher/client/base.py (+17/-2)
To merge this branch: bzr merge lp:~le-chi-thu/lava-dispatcher/skip-home-screen-hcj
Reviewer Review Type Date Requested Status
Zygmunt Krynicki (community) Approve
Review via email: mp+106821@code.launchpad.net

Description of the change

skip raising exception when home screen if it is health check jobs

To post a comment you must log in.
Revision history for this message
Zygmunt Krynicki (zyga) wrote :

While this looks okay I hate how we have to hard-code such details in python. This is not a constructive rant, feel free to ignore it.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'doc/changes.rst'
--- doc/changes.rst 2012-05-17 21:25:09 +0000
+++ doc/changes.rst 2012-05-22 14:36:24 +0000
@@ -1,6 +1,8 @@
1Version History1Version History
2***************2***************
33
4* Skip raising exception on the home screen has not displayed for health check jobs
5
4.. _version_0_7_1:6.. _version_0_7_1:
57
6Version 0.7.18Version 0.7.1
79
=== modified file 'lava_dispatcher/client/base.py'
--- lava_dispatcher/client/base.py 2012-05-17 13:02:48 +0000
+++ lava_dispatcher/client/base.py 2012-05-22 14:36:24 +0000
@@ -350,7 +350,14 @@
350 pass350 pass
351 session.android_adb_connect(dev_ip)351 session.android_adb_connect(dev_ip)
352 session.wait_until_attached()352 session.wait_until_attached()
353 session.wait_home_screen()353 try:
354 session.wait_home_screen()
355 except:
356 # ignore home screen exception if it is a health check job.
357 if not (self.context.job_data.has_key("health_check") and self.context.job_data["health_check"] == True):
358 raise
359 else:
360 logging.info("Skip raising exception on the home screen has not displayed for health check jobs")
354 try:361 try:
355 yield session362 yield session
356 finally:363 finally:
@@ -442,7 +449,15 @@
442 """ disable the suspend of images. 449 """ disable the suspend of images.
443 this needs wait unitl the home screen displayed"""450 this needs wait unitl the home screen displayed"""
444 session = AndroidTesterCommandRunner(self)451 session = AndroidTesterCommandRunner(self)
445 session.wait_home_screen()452 try:
453 session.wait_home_screen()
454 except:
455 # ignore home screen exception if it is a health check job.
456 if not (self.context.job_data.has_key("health_check") and self.context.job_data["health_check"] == True):
457 raise
458 else:
459 logging.info("Skip raising exception on the home screen has not displayed for health check jobs")
460
446 stay_awake = "delete from system where name='stay_on_while_plugged_in'; insert into system (name, value) values ('stay_on_while_plugged_in','3');"461 stay_awake = "delete from system where name='stay_on_while_plugged_in'; insert into system (name, value) values ('stay_on_while_plugged_in','3');"
447 screen_sleep = "delete from system where name='screen_off_timeout'; insert into system (name, value) values ('screen_off_timeout','-1');"462 screen_sleep = "delete from system where name='screen_off_timeout'; insert into system (name, value) values ('screen_off_timeout','-1');"
448 lockscreen = "delete from secure where name='lockscreen.disabled'; insert into secure (name, value) values ('lockscreen.disabled','1');"463 lockscreen = "delete from secure where name='lockscreen.disabled'; insert into secure (name, value) values ('lockscreen.disabled','1');"

Subscribers

People subscribed via source and target branches