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
=== modified file 'build-scripts/post-build-lava.py'
--- build-scripts/post-build-lava.py 2012-06-18 11:52:58 +0000
+++ build-scripts/post-build-lava.py 2012-06-18 13:23:24 +0000
@@ -49,6 +49,7 @@
49}49}
5050
51OPTION_SUFFIX = "_OPTION"51OPTION_SUFFIX = "_OPTION"
52TIMEOUT_SUFFIX = "_TIMEOUT"
52# Special token for LAVA_TEST_PLAN that allows the build owner to encode a53# Special token for LAVA_TEST_PLAN that allows the build owner to encode a
53# reboot in between test actions.54# reboot in between test actions.
54REBOOT_TOKEN = '[system-reboot]'55REBOOT_TOKEN = '[system-reboot]'
@@ -77,6 +78,11 @@
77 if test_option:78 if test_option:
78 parameters['option'] = test_option79 parameters['option'] = test_option
7980
81 timeout_option = os.environ.get('%s%s' % (test.upper(),
82 TIMEOUT_SUFFIX))
83 if timeout_option:
84 parameters['timeout'] = int(timeout_option)
85
80 if test != REBOOT_TOKEN:86 if test != REBOOT_TOKEN:
81 run_action = {87 run_action = {
82 "command": "lava_android_test_run",88 "command": "lava_android_test_run",
@@ -101,7 +107,7 @@
101 return gen_lava_android_test_actions(test_plans)107 return gen_lava_android_test_actions(test_plans)
102108
103109
104def gen_command_action(commands=[], cmd_file=None, parser=None):110def gen_command_action(commands=[], cmd_file=None, parser=None, timeout=None):
105 parameters = None111 parameters = None
106 if commands:112 if commands:
107 parameters = {'commands': commands}113 parameters = {'commands': commands}
@@ -111,6 +117,9 @@
111 if parameters and parser:117 if parameters and parser:
112 parameters['parser'] = parser118 parameters['parser'] = parser
113119
120 if timeout:
121 parameters['timeout'] = int(timeout)
122
114 action = {"command": "lava_android_test_run_custom",123 action = {"command": "lava_android_test_run_custom",
115 "parameters": parameters}124 "parameters": parameters}
116 return action125 return action
@@ -123,14 +132,17 @@
123 test_list = []132 test_list = []
124 for var in os.environ.keys():133 for var in os.environ.keys():
125 if var.startswith(prefix) and (not var.endswith(pat_suffix)) \134 if var.startswith(prefix) and (not var.endswith(pat_suffix)) \
126 and (var != 'LAVA_TEST_PLAN'):135 and (var != 'LAVA_TEST_PLAN') \
136 and (not var.endswith(TIMEOUT_SUFFIX)):
127 test_list.append(var)137 test_list.append(var)
128 test_list.sort()138 test_list.sort()
129 for var in test_list:139 for var in test_list:
130 cmd = os.environ.get(var)140 cmd = os.environ.get(var)
131 pattern = os.environ.get('%s%s' % (var, pat_suffix))141 pattern = os.environ.get('%s%s' % (var, pat_suffix))
142 timeout = os.environ.get('%s%s' % (var, TIMEOUT_SUFFIX))
132 test_actions.append(gen_command_action(commands=[cmd],143 test_actions.append(gen_command_action(commands=[cmd],
133 parser=pattern))144 parser=pattern,
145 timeout=timeout))
134146
135 return test_actions147 return test_actions
136148
@@ -140,17 +152,18 @@
140 prefix = 'MONKEY_RUNNER_URL_'152 prefix = 'MONKEY_RUNNER_URL_'
141 test_list = []153 test_list = []
142 for var in os.environ.keys():154 for var in os.environ.keys():
143 if var.startswith(prefix):155 if var.startswith(prefix) and (not var.endswith(TIMEOUT_SUFFIX)):
144 test_list.append(var)156 test_list.append(var)
145 test_list.sort()157 test_list.sort()
146 for var in test_list:158 for var in test_list:
147 url = os.environ.get(var)159 url = os.environ.get(var)
160 parameters = {"url": url}
161 timeout = os.environ.get('%s%s' % (var, TIMEOUT_SUFFIX))
162 if timeout:
163 parameters['timeout'] = int(timeout)
148 action = {164 action = {
149 "command": "lava_android_test_run_monkeyrunner",165 "command": "lava_android_test_run_monkeyrunner",
150 "parameters":166 "parameters": parameters
151 {
152 "url": url
153 }
154 }167 }
155 test_actions.append(action)168 test_actions.append(action)
156 return test_actions169 return test_actions
@@ -193,6 +206,10 @@
193 else:206 else:
194 enable_android_install_binaries = False207 enable_android_install_binaries = False
195208
209 # Set the default timeout for all test,
210 # if this value is not set, then use the 18000 seconds as the default value
211 default_timeout = os.environ.get("DEFAULT_TIMEOUT", 18000)
212
196 # Board-specific parameters213 # Board-specific parameters
197 if target_product not in PRODUCT_MAP:214 if target_product not in PRODUCT_MAP:
198 # We don't know how to test this job, so skip testing.215 # We don't know how to test this job, so skip testing.
@@ -249,7 +266,7 @@
249266
250 config_json = {"job_name": build_url,267 config_json = {"job_name": build_url,
251 "image_type": 'android',268 "image_type": 'android',
252 "timeout": 18000,269 "timeout": int(default_timeout),
253 "actions": actions270 "actions": actions
254 }271 }
255272

Subscribers

People subscribed via source and target branches