diff mbox

[Branch,~linaro-validation/lava-dispatcher/trunk] Rev 315: merge the branch that fix the timeout problem of wait_home_screen for android

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

Commit Message

Yongqin Liu June 6, 2012, 3:18 a.m. UTC
Merge authors:
  Yongqin Liu (liuyq0307)
Related merge proposals:
  https://code.launchpad.net/~liuyq0307/lava-dispatcher/timeout_wait_home_screen/+merge/108138
  proposed by: Yongqin Liu (liuyq0307)
  review: Approve - Michael Hudson-Doyle (mwhudson)
  review: Approve - Yongqin Liu (liuyq0307)
  review: Needs Information - Zygmunt Krynicki (zkrynicki)
  https://code.launchpad.net/~liuyq0307/lava-dispatcher/disable_suspend_first/+merge/106316
  proposed by: Yongqin Liu (liuyq0307)
------------------------------------------------------------
revno: 315 [merge]
committer: Yongqin Liu <yongqin.liu@linaro.org>
branch nick: lava-dispatcher
timestamp: Wed 2012-06-06 11:15:25 +0800
message:
  merge the branch that fix the timeout problem of wait_home_screen for android
modified:
  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 'lava_dispatcher/client/base.py'
--- lava_dispatcher/client/base.py	2012-05-23 21:49:59 +0000
+++ lava_dispatcher/client/base.py	2012-05-31 10:43:31 +0000
@@ -235,10 +235,12 @@ 
     def wait_home_screen(self):
         cmd = 'getprop init.svc.bootanim'
         for count in range(100):
-            self.run(cmd, response=['stopped', pexpect.TIMEOUT], timeout=5)
-            if self.match_id == 0:
-                return True
-            time.sleep(1)
+            try:
+                self.run(cmd, response=['stopped'], timeout=5)
+                if self.match_id == 0:
+                    return True
+            except pexpect.TIMEOUT:
+                time.sleep(1)
         raise GeneralError('The home screen has not displayed')
 
     def check_device_state(self):
@@ -439,12 +441,12 @@ 
         self.proc.expect(self.tester_str, timeout=120)
         #TODO: set up proxy
 
+        self._disable_suspend()
         if self.config.get("enable_network_after_boot_android"):
             time.sleep(1)
             self._enable_network()
 
         self._enable_adb_over_tcpip()
-        self._disable_suspend()
 
     def _disable_suspend(self):
         """ disable the suspend of images.