Merge lp:~liuyq0307/linaro-android-build-tools/support-timeout into lp:linaro-android-build-tools

Proposed by Yongqin Liu
Status: Superseded
Proposed branch: lp:~liuyq0307/linaro-android-build-tools/support-timeout
Merge into: lp:linaro-android-build-tools
Diff against target: 105 lines (+26/-9)
1 file modified
build-scripts/post-build-lava.py (+26/-9)
To merge this branch: bzr merge lp:~liuyq0307/linaro-android-build-tools/support-timeout
Reviewer Review Type Date Requested Status
Milo Casagrande (community) Approve
Paul Sokolovsky Pending
Review via email: mp+109985@code.launchpad.net

This proposal has been superseded by a proposal from 2012-06-18.

Description of the change

Add support for timeout option for each test actions.
And the wiki following has been updated about how to use the timeout support:
https://wiki.linaro.org/Platform/Android/AndroidBuild-LavaIntegration#preview

To post a comment you must log in.
Revision history for this message
Milo Casagrande (milo) wrote :

Hi Yongqin,

thanks for working on this. Overall the merge proposal looks good to me, just a couple of really small comments.

On Fri, Jun 15, 2012 at 10:44 AM, Paul Sokolovsky <email address hidden> wrote:
>
> +    # Set the default timeout for all test,
> +    # if this value it not set, then use the 3600 seconds as the default value
> +    default_timeout = os.environ.get("DEFAULT_TIMEOUT", 3600)

Just a small typo here: s/it not/is not

>     config_json = {"job_name": build_url,
>                    "image_type": 'android',
> -                   "timeout": 18000,
> +                   "timeout": int(default_timeout),
>                    "actions": actions
>                   }

The old timeout here was set to 18000 seconds, now you set a default value of 3600: has it been discussed somewhere to lower the timeout?

Also, even if not introduced by you, can you please fix these two errors from pep8:

post-build-lava.py:44:15: E203 whitespace before ':'
post-build-lava.py:185:80: E501 line too long (100 characters)

Thanks.

review: Needs Information
489. By Yongqin Liu

modify according to the review comment

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

> Hi Yongqin,
>
> thanks for working on this. Overall the merge proposal looks good to me, just
> a couple of really small comments.
>
> On Fri, Jun 15, 2012 at 10:44 AM, Paul Sokolovsky <email address hidden>
> wrote:
> >
> > +    # Set the default timeout for all test,
> > +    # if this value it not set, then use the 3600 seconds as the default
> value
> > +    default_timeout = os.environ.get("DEFAULT_TIMEOUT", 3600)

> Just a small typo here: s/it not/is not
> Also, even if not introduced by you, can you please fix these two errors from
> pep8:
>
> post-build-lava.py:44:15: E203 whitespace before ':'
> post-build-lava.py:185:80: E501 line too long (100 characters)

Thanks, the above typo and this two lines have been updated.

> >     config_json = {"job_name": build_url,
> >                    "image_type": 'android',
> > -                   "timeout": 18000,
> > +                   "timeout": int(default_timeout),
> >                    "actions": actions
> >                   }
>
> The old timeout here was set to 18000 seconds, now you set a default value of
> 3600: has it been discussed somewhere to lower the timeout?
For this, I have asked about it in lava team, the timeout is not used before.
This is the first time that it will be used.
And from the tests we have now, mainly less than 1 hour.
So I set it to 3600.

But it's seems set it to 18000 is more reasonable.
1. keep it as it was before, although not used before
2. only the CTS test need to be specifically set.
   **The CTS test will need more time, about 10H.

Now I changed it to 18000

490. By Yongqin Liu

change the default timeout to 18000 back

Revision history for this message
Milo Casagrande (milo) wrote :

Hello Yongqin,

looks good to me! Thanks for taking care of this!

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

Thanks, and also perhaps need you help me to merge this branch.
I should not have the permission to do that.

Thanks very much.

Yongqin Liu

Revision history for this message
Milo Casagrande (milo) wrote :

Hello Yongqin,

sorry for the delay, I thought you could merge by yourself.

Can you please re-align with trunk? I merged another request, and here we get a couple of conflicts. If you can do it by today, I'll merge everything ASAP.

Thanks.

491. By Yongqin Liu

merge with trunk

Unmerged revisions

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'build-scripts/post-build-lava.py'
2--- build-scripts/post-build-lava.py 2012-06-18 11:52:58 +0000
3+++ build-scripts/post-build-lava.py 2012-06-18 13:23:24 +0000
4@@ -49,6 +49,7 @@
5 }
6
7 OPTION_SUFFIX = "_OPTION"
8+TIMEOUT_SUFFIX = "_TIMEOUT"
9 # Special token for LAVA_TEST_PLAN that allows the build owner to encode a
10 # reboot in between test actions.
11 REBOOT_TOKEN = '[system-reboot]'
12@@ -77,6 +78,11 @@
13 if test_option:
14 parameters['option'] = test_option
15
16+ timeout_option = os.environ.get('%s%s' % (test.upper(),
17+ TIMEOUT_SUFFIX))
18+ if timeout_option:
19+ parameters['timeout'] = int(timeout_option)
20+
21 if test != REBOOT_TOKEN:
22 run_action = {
23 "command": "lava_android_test_run",
24@@ -101,7 +107,7 @@
25 return gen_lava_android_test_actions(test_plans)
26
27
28-def gen_command_action(commands=[], cmd_file=None, parser=None):
29+def gen_command_action(commands=[], cmd_file=None, parser=None, timeout=None):
30 parameters = None
31 if commands:
32 parameters = {'commands': commands}
33@@ -111,6 +117,9 @@
34 if parameters and parser:
35 parameters['parser'] = parser
36
37+ if timeout:
38+ parameters['timeout'] = int(timeout)
39+
40 action = {"command": "lava_android_test_run_custom",
41 "parameters": parameters}
42 return action
43@@ -123,14 +132,17 @@
44 test_list = []
45 for var in os.environ.keys():
46 if var.startswith(prefix) and (not var.endswith(pat_suffix)) \
47- and (var != 'LAVA_TEST_PLAN'):
48+ and (var != 'LAVA_TEST_PLAN') \
49+ and (not var.endswith(TIMEOUT_SUFFIX)):
50 test_list.append(var)
51 test_list.sort()
52 for var in test_list:
53 cmd = os.environ.get(var)
54 pattern = os.environ.get('%s%s' % (var, pat_suffix))
55+ timeout = os.environ.get('%s%s' % (var, TIMEOUT_SUFFIX))
56 test_actions.append(gen_command_action(commands=[cmd],
57- parser=pattern))
58+ parser=pattern,
59+ timeout=timeout))
60
61 return test_actions
62
63@@ -140,17 +152,18 @@
64 prefix = 'MONKEY_RUNNER_URL_'
65 test_list = []
66 for var in os.environ.keys():
67- if var.startswith(prefix):
68+ if var.startswith(prefix) and (not var.endswith(TIMEOUT_SUFFIX)):
69 test_list.append(var)
70 test_list.sort()
71 for var in test_list:
72 url = os.environ.get(var)
73+ parameters = {"url": url}
74+ timeout = os.environ.get('%s%s' % (var, TIMEOUT_SUFFIX))
75+ if timeout:
76+ parameters['timeout'] = int(timeout)
77 action = {
78 "command": "lava_android_test_run_monkeyrunner",
79- "parameters":
80- {
81- "url": url
82- }
83+ "parameters": parameters
84 }
85 test_actions.append(action)
86 return test_actions
87@@ -193,6 +206,10 @@
88 else:
89 enable_android_install_binaries = False
90
91+ # Set the default timeout for all test,
92+ # if this value is not set, then use the 18000 seconds as the default value
93+ default_timeout = os.environ.get("DEFAULT_TIMEOUT", 18000)
94+
95 # Board-specific parameters
96 if target_product not in PRODUCT_MAP:
97 # We don't know how to test this job, so skip testing.
98@@ -249,7 +266,7 @@
99
100 config_json = {"job_name": build_url,
101 "image_type": 'android',
102- "timeout": 18000,
103+ "timeout": int(default_timeout),
104 "actions": actions
105 }
106

Subscribers

People subscribed via source and target branches