Commit 81dd2912 authored by Stephen Roe's avatar Stephen Roe Committed by Commit Bot

[fuchsia] Keep amber repo running during blink_web_tests.

Previously the amber repository only ran during initial package
installation.  Since 2020-04-08 it is required during the entire
test run.

Bug: 1033565
Change-Id: If21cfeefaf8de0a4680aedcd31f79ba35d3e9577
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2159372Reviewed-by: default avatarWez <wez@chromium.org>
Reviewed-by: default avatarNico Weber <thakis@chromium.org>
Commit-Queue: Stephen Roe <steveroe@google.com>
Cr-Commit-Position: refs/heads/master@{#763425}
parent 05a6e9f6
...@@ -127,6 +127,7 @@ class _TargetHost(object): ...@@ -127,6 +127,7 @@ class _TargetHost(object):
def __init__(self, build_path, build_ids_path, ports_to_forward, def __init__(self, build_path, build_ids_path, ports_to_forward,
target_device, results_directory): target_device, results_directory):
try: try:
self._amber_repo = None
self._target = None self._target = None
target_args = { target_args = {
'output_dir': build_path, 'output_dir': build_path,
...@@ -177,6 +178,9 @@ class _TargetHost(object): ...@@ -177,6 +178,9 @@ class _TargetHost(object):
self.symbolizer = symbolizer.RunSymbolizer( self.symbolizer = symbolizer.RunSymbolizer(
self._listener.stdout, listener_log, [build_ids_path]) self._listener.stdout, listener_log, [build_ids_path])
self._amber_repo = self._target.GetAmberRepo()
self._amber_repo.__enter__()
package_path = os.path.join(build_path, CONTENT_SHELL_PACKAGE_PATH) package_path = os.path.join(build_path, CONTENT_SHELL_PACKAGE_PATH)
self._target.InstallPackage([package_path]) self._target.InstallPackage([package_path])
...@@ -194,6 +198,8 @@ class _TargetHost(object): ...@@ -194,6 +198,8 @@ class _TargetHost(object):
stderr=subprocess.PIPE) stderr=subprocess.PIPE)
def cleanup(self): def cleanup(self):
if self._amber_repo:
self._amber_repo.__exit__(None, None, None)
if self._target: if self._target:
# TODO(sergeyu): Currently __init__() always starts Qemu, so we can # TODO(sergeyu): Currently __init__() always starts Qemu, so we can
# just shutdown it. Update this logic when reusing target devices # just shutdown it. Update this logic when reusing target devices
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment