-
Notifications
You must be signed in to change notification settings - Fork 564
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
tasks: add support for both 'jobs-android' and device specific subqueues #4013
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -122,6 +122,11 @@ def default_queue_suffix(): | |
return queue_suffix_for_platform(environment.platform()) | ||
|
||
|
||
def generic_android_queue(prefix=JOBS_PREFIX): | ||
"""Get the generic 'android' queue that is not tied to a specific device.""" | ||
return prefix + queue_suffix_for_platform(environment.platform()) | ||
|
||
|
||
def regular_queue(prefix=JOBS_PREFIX): | ||
"""Get the regular jobs queue.""" | ||
return prefix + default_queue_suffix() | ||
|
@@ -190,6 +195,21 @@ def get_regular_task(queue=None): | |
return task | ||
|
||
|
||
def get_android_regular_task(): | ||
"""Get an android regular task.""" | ||
if not environment.get_value('CF_ALLOWS_LISTENING_GENERIC_QUEUE') or \ | ||
not environment.get_value('QUEUE_OVERRIDE'): | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't believe we set the |
||
return get_regular_task() | ||
|
||
# We first try to grab a task on the regular default queue, which is the | ||
# device specific subqueue. | ||
task = get_regular_task(queue=regular_queue()) | ||
if not task: | ||
# We then try the generic queue. | ||
task = get_regular_task(queue=generic_android_queue()) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm concerned that pulling from the generic queue will lead to incompatible testcases being picked up (like the error log shows below).
Is that right? If so, the testcase ("task") will be re-added to the top of the queue and continue in a cycle, meaning the bot will never move on to fuzzing tasks, which only occur when no testcases are left. |
||
return task | ||
|
||
|
||
def get_machine_template_for_queue(queue_name): | ||
"""Gets the machine template for the instance used to execute a task from | ||
|queue_name|. This will be used by tworkers to schedule the appropriate | ||
|
@@ -316,7 +336,10 @@ def get_task(): | |
if task: | ||
return task | ||
|
||
task = get_regular_task() | ||
if environment.is_android(): | ||
task = get_android_regular_task() | ||
else: | ||
task = get_regular_task() | ||
if task: | ||
# Log the task details for debug purposes. | ||
logs.log(f'Got task with cmd {task.command} args {task.argument} ' | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As discussed in meet, let's make this default as opposed to introducing new env var