Merge lp:~liuyq0307/lava-dispatcher/timeout_wait_home_screen into lp:lava-dispatcher

Proposed by Yongqin Liu
Status: Merged
Merged at revision: 315
Proposed branch: lp:~liuyq0307/lava-dispatcher/timeout_wait_home_screen
Merge into: lp:lava-dispatcher
Diff against target: 34 lines (+7/-5)
1 file modified
lava_dispatcher/client/base.py (+7/-5)
To merge this branch: bzr merge lp:~liuyq0307/lava-dispatcher/timeout_wait_home_screen
Reviewer Review Type Date Requested Status
Michael Hudson-Doyle (community) Approve
Yongqin Liu test with staging Approve
Zygmunt Krynicki (community) Needs Information
Review via email: mp+108138@code.launchpad.net

Description of the change

delete the timeout in response in wait_home_screen method

To post a comment you must log in.
Revision history for this message
Yongqin Liu (liuyq0307) wrote :

not tested yet. please just review from the source point.

And is there somebody can me have permission to modify the file below:
 /srv/lava/instances/staging/lib/python2.7/site-packages/lava_dispatcher/client/base.py

Revision history for this message
Yongqin Liu (liuyq0307) wrote :

reverted the panda.conf. seems no need to modify this file.

299. By Yongqin Liu

revert panda.conf

Revision history for this message
Zygmunt Krynicki (zyga) wrote :

8 - self.run(cmd, response=['stopped', pexpect.TIMEOUT], timeout=5)
9 - if self.match_id == 0:
10 - return True
11 - time.sleep(1)
12 + try:
13 + self.run(cmd, response=['stopped'], timeout=5)
14 + if self.match_id == 0:
15 + return True
16 + except pexpect.TIMEOUT:
17 + time.sleep(1)

What is the logical change this part is supposed to make? I don't see any. You've traded the explicit timeout handling to an exception based timeout handling

review: Needs Information
Revision history for this message
Yongqin Liu (liuyq0307) wrote :

below is the talk with mwhudson about this.

<liuyq> mwhudson, in method wait_home_screen, it is now using "self.run(cmd, response=['stopped', pexpect.TIMEOUT], timeout=5)" to catch timeout
<liuyq> mwhudson, but in fact, the "TIMEOUT: Timeout exceeded in read_nonblocking()." is not caught
<liuyq> mwhudson, so I consider how about trying catch TIMEOUT sentence there
<liuyq> mwhudson, not catch the timeout in the response
<liuyq> mwhudson, how do you think about that?
<mwhudson> liuyq: oh heh
<mwhudson> liuyq: that sounds like a bug actually
<mwhudson> liuyq: if you pass pexpect.TIMEOUT in response the code still waits for the prompt
<mwhudson> and that probably won't appear
<mwhudson> so it will raise an exception
<mwhudson> liuyq: can you file a bug on lava-dispatcher about this?
<mwhudson> liuyq: in the mean time, just catch pexpect.TIMEOUT I guess
<liuyq> mwhudson, sorry, why do you say "and that probably won't appear", the prompt “root@linaro” should appear
<mwhudson> liuyq: but it only waits one more second for the root@linaro to appear
<mwhudson> liuyq: if the timeout is 5 seconds and nothing has appeared, the root@linaro _probably_ won't appear in that 1 more second

Revision history for this message
Zygmunt Krynicki (zyga) wrote :

Ok, please open a bug on pexpect about this and link it here.

Revision history for this message
Yongqin Liu (liuyq0307) wrote :

The test has been done as below:
1. 6 jobs are submitted to staging
2. each job contain deploy_linaro_android_image action and 20 boot_linaro_android_image actions.
And the result is that all the actions are passed.

review: Approve (test with staging)
Revision history for this message
Yongqin Liu (liuyq0307) wrote :

> Ok, please open a bug on pexpect about this and link it here.
About this, even it's a bug on pexpect, we still need to work around it to make our lava works well until it's fixed on pexpect.
So this branch is necessary for us at least now.

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

The bug in timeout handling is in the dispatcher, not pexpect. Can you file a bug in lava-dispatcher and link to it in a comment in the code?

Otherwise, this makes sense to me.

review: Approve
Revision history for this message
Yongqin Liu (liuyq0307) wrote :

> The bug in timeout handling is in the dispatcher, not pexpect. Can you file a
> bug in lava-dispatcher and link to it in a comment in the code?
This bug has already been linked to bug https://bugs.launchpad.net/lava-dispatcher/+bug/1001112
Is that bug not what you want?

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

Yongqin Liu <email address hidden> writes:

>> The bug in timeout handling is in the dispatcher, not pexpect. Can you file a
>> bug in lava-dispatcher and link to it in a comment in the code?
> This bug has already been linked to bug https://bugs.launchpad.net/lava-dispatcher/+bug/1001112
> Is that bug not what you want?

I meant to file a new bug, so I did that:
https://bugs.launchpad.net/lava-dispatcher/+bug/1009302

Cheers,
mwh

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== 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 11:09:19 +0000
@@ -235,10 +235,12 @@
235 def wait_home_screen(self):235 def wait_home_screen(self):
236 cmd = 'getprop init.svc.bootanim'236 cmd = 'getprop init.svc.bootanim'
237 for count in range(100):237 for count in range(100):
238 self.run(cmd, response=['stopped', pexpect.TIMEOUT], timeout=5)238 try:
239 if self.match_id == 0:239 self.run(cmd, response=['stopped'], timeout=5)
240 return True240 if self.match_id == 0:
241 time.sleep(1)241 return True
242 except pexpect.TIMEOUT:
243 time.sleep(1)
242 raise GeneralError('The home screen has not displayed')244 raise GeneralError('The home screen has not displayed')
243245
244 def check_device_state(self):246 def check_device_state(self):
@@ -439,12 +441,12 @@
439 self.proc.expect(self.tester_str, timeout=120)441 self.proc.expect(self.tester_str, timeout=120)
440 #TODO: set up proxy442 #TODO: set up proxy
441443
444 self._disable_suspend()
442 if self.config.get("enable_network_after_boot_android"):445 if self.config.get("enable_network_after_boot_android"):
443 time.sleep(1)446 time.sleep(1)
444 self._enable_network()447 self._enable_network()
445448
446 self._enable_adb_over_tcpip()449 self._enable_adb_over_tcpip()
447 self._disable_suspend()
448450
449 def _disable_suspend(self):451 def _disable_suspend(self):
450 """ disable the suspend of images. 452 """ disable the suspend of images.

Subscribers

People subscribed via source and target branches