mirror of
https://github.com/ARM-software/devlib.git
synced 2025-01-31 02:00:45 +00:00
target: Ensure max_async is used during connect
method
The value for `max_async` when creating a target was being ignored if a connection was not established as part of the __init__ method. Save this value for use via `connect` if called directly.
This commit is contained in:
parent
93ada9762d
commit
7f778e767d
@ -344,6 +344,7 @@ class Target(object):
|
|||||||
self._cache = {}
|
self._cache = {}
|
||||||
self._shutils = None
|
self._shutils = None
|
||||||
self._file_transfer_cache = None
|
self._file_transfer_cache = None
|
||||||
|
self._max_async = max_async
|
||||||
self.busybox = None
|
self.busybox = None
|
||||||
|
|
||||||
if load_default_modules:
|
if load_default_modules:
|
||||||
@ -387,7 +388,7 @@ class Target(object):
|
|||||||
# connection and initialization
|
# connection and initialization
|
||||||
|
|
||||||
@asyn.asyncf
|
@asyn.asyncf
|
||||||
async def connect(self, timeout=None, check_boot_completed=True, max_async=50):
|
async def connect(self, timeout=None, check_boot_completed=True, max_async=None):
|
||||||
self.platform.init_target_connection(self)
|
self.platform.init_target_connection(self)
|
||||||
# Forcefully set the thread-local value for the connection, with the
|
# Forcefully set the thread-local value for the connection, with the
|
||||||
# timeout we want
|
# timeout we want
|
||||||
@ -400,7 +401,7 @@ class Target(object):
|
|||||||
self.execute('mkdir -p {}'.format(quote(self.executables_directory)))
|
self.execute('mkdir -p {}'.format(quote(self.executables_directory)))
|
||||||
self.busybox = self.install(os.path.join(PACKAGE_BIN_DIRECTORY, self.abi, 'busybox'), timeout=30)
|
self.busybox = self.install(os.path.join(PACKAGE_BIN_DIRECTORY, self.abi, 'busybox'), timeout=30)
|
||||||
self.conn.busybox = self.busybox
|
self.conn.busybox = self.busybox
|
||||||
self._detect_max_async(max_async)
|
self._detect_max_async(max_async or self._max_async)
|
||||||
self.platform.update_from_target(self)
|
self.platform.update_from_target(self)
|
||||||
self._update_modules('connected')
|
self._update_modules('connected')
|
||||||
if self.platform.big_core and self.load_default_modules:
|
if self.platform.big_core and self.load_default_modules:
|
||||||
@ -1824,7 +1825,7 @@ class AndroidTarget(Target):
|
|||||||
raise TargetStableError('Connected but Android did not fully boot.')
|
raise TargetStableError('Connected but Android did not fully boot.')
|
||||||
|
|
||||||
@asyn.asyncf
|
@asyn.asyncf
|
||||||
async def connect(self, timeout=30, check_boot_completed=True, max_async=50): # pylint: disable=arguments-differ
|
async def connect(self, timeout=30, check_boot_completed=True, max_async=None): # pylint: disable=arguments-differ
|
||||||
device = self.connection_settings.get('device')
|
device = self.connection_settings.get('device')
|
||||||
await super(AndroidTarget, self).connect.asyn(
|
await super(AndroidTarget, self).connect.asyn(
|
||||||
timeout=timeout,
|
timeout=timeout,
|
||||||
@ -2998,7 +2999,7 @@ class ChromeOsTarget(LinuxTarget):
|
|||||||
else:
|
else:
|
||||||
raise
|
raise
|
||||||
|
|
||||||
def connect(self, timeout=30, check_boot_completed=True, max_async=50):
|
def connect(self, timeout=30, check_boot_completed=True, max_async=None):
|
||||||
super(ChromeOsTarget, self).connect(
|
super(ChromeOsTarget, self).connect(
|
||||||
timeout=timeout,
|
timeout=timeout,
|
||||||
check_boot_completed=check_boot_completed,
|
check_boot_completed=check_boot_completed,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user