diff mbox

[Branch,~linaro-validation/lava-dispatcher/trunk] Rev 298: skip raising exception when home screen if it is health check jobs

Message ID 20120523215212.5062.64719.launchpad@ackee.canonical.com
State Accepted
Headers show

Commit Message

Le Chi Thu May 23, 2012, 9:52 p.m. UTC
Merge authors:
  Le Chi Thu le.chi.thu@linaro.org <le.chi.thu@linaro.org>
Related merge proposals:
  https://code.launchpad.net/~le-chi-thu/lava-dispatcher/skip-home-screen-hcj/+merge/106821
  proposed by: Le Chi Thu (le-chi-thu)
  review: Approve - Zygmunt Krynicki (zkrynicki)
------------------------------------------------------------
revno: 298 [merge]
committer: Le Chi Thu le.chi.thu@linaro.org <le.chi.thu@linaro.org>
branch nick: trunk
timestamp: Wed 2012-05-23 23:49:59 +0200
message:
  skip raising exception when home screen if it is health check jobs
modified:
  doc/changes.rst
  lava_dispatcher/client/base.py


--
lp:lava-dispatcher
https://code.launchpad.net/~linaro-validation/lava-dispatcher/trunk

You are subscribed to branch lp:lava-dispatcher.
To unsubscribe from this branch go to https://code.launchpad.net/~linaro-validation/lava-dispatcher/trunk/+edit-subscription
diff mbox

Patch

=== modified file 'doc/changes.rst'
--- doc/changes.rst	2012-05-22 13:12:56 +0000
+++ doc/changes.rst	2012-05-23 21:49:59 +0000
@@ -2,6 +2,7 @@ 
 ***************
 
 * Fixed reboot issues
+* Skip raising exception on the home screen has not displayed for health check jobs
 
 .. _version_0_7_1:
 

=== modified file 'lava_dispatcher/client/base.py'
--- lava_dispatcher/client/base.py	2012-05-22 13:03:31 +0000
+++ lava_dispatcher/client/base.py	2012-05-23 21:49:59 +0000
@@ -350,7 +350,14 @@ 
             pass
         session.android_adb_connect(dev_ip)
         session.wait_until_attached()
-        session.wait_home_screen()
+        try:
+            session.wait_home_screen()
+        except:
+            # ignore home screen exception if it is a health check job.
+            if not (self.context.job_data.has_key("health_check") and self.context.job_data["health_check"] == True):
+                raise
+            else:
+                logging.info("Skip raising exception on the home screen has not displayed for health check jobs")
         try:
             yield session
         finally:
@@ -443,7 +450,15 @@ 
         """ disable the suspend of images. 
         this needs wait unitl the home screen displayed"""
         session = AndroidTesterCommandRunner(self)
-        session.wait_home_screen()
+        try:
+            session.wait_home_screen()
+        except:
+            # ignore home screen exception if it is a health check job.
+            if not (self.context.job_data.has_key("health_check") and self.context.job_data["health_check"] == True):
+                raise
+            else:
+                logging.info("Skip raising exception on the home screen has not displayed for health check jobs")
+
         stay_awake = "delete from system where name='stay_on_while_plugged_in'; insert into system (name, value) values ('stay_on_while_plugged_in','3');"
         screen_sleep = "delete from system where name='screen_off_timeout'; insert into system (name, value) values ('screen_off_timeout','-1');"
         lockscreen = "delete from secure where name='lockscreen.disabled'; insert into secure (name, value) values ('lockscreen.disabled','1');"