mirror of
https://github.com/ARM-software/workload-automation.git
synced 2025-02-22 12:58:36 +00:00
fix: telemetry: ignore all return codes
Telemetry seems to return random values as return code, so completely ignore them and don't treat any values as errors.
This commit is contained in:
parent
c31d4ec8a3
commit
506ed57ca6
@ -81,7 +81,7 @@ def check_output(command, timeout=None, ignore=None, **kwargs):
|
|||||||
ignore = []
|
ignore = []
|
||||||
elif isinstance(ignore, int):
|
elif isinstance(ignore, int):
|
||||||
ignore = [ignore]
|
ignore = [ignore]
|
||||||
elif not isinstance(ignore, list):
|
elif not isinstance(ignore, list) and ignore != 'all':
|
||||||
message = 'Invalid value for ignore parameter: "{}"; must be an int or a list'
|
message = 'Invalid value for ignore parameter: "{}"; must be an int or a list'
|
||||||
raise ValueError(message.format(ignore))
|
raise ValueError(message.format(ignore))
|
||||||
if 'stdout' in kwargs:
|
if 'stdout' in kwargs:
|
||||||
@ -111,7 +111,7 @@ def check_output(command, timeout=None, ignore=None, **kwargs):
|
|||||||
if retcode:
|
if retcode:
|
||||||
if retcode == -9: # killed, assume due to timeout callback
|
if retcode == -9: # killed, assume due to timeout callback
|
||||||
raise TimeoutError(command, output='\n'.join([output, error]))
|
raise TimeoutError(command, output='\n'.join([output, error]))
|
||||||
elif retcode not in ignore:
|
elif ignore != 'all' and retcode not in ignore:
|
||||||
raise subprocess.CalledProcessError(retcode, command, output='\n'.join([output, error]))
|
raise subprocess.CalledProcessError(retcode, command, output='\n'.join([output, error]))
|
||||||
return output, error
|
return output, error
|
||||||
|
|
||||||
|
@ -133,7 +133,7 @@ class Telemetry(Workload):
|
|||||||
|
|
||||||
def run(self, context):
|
def run(self, context):
|
||||||
self.logger.debug(self.command)
|
self.logger.debug(self.command)
|
||||||
self.raw_output, _ = check_output(self.command, shell=True, timeout=self.run_timeout, ignore=range(256))
|
self.raw_output, _ = check_output(self.command, shell=True, timeout=self.run_timeout, ignore='all')
|
||||||
|
|
||||||
def update_result(self, context): # pylint: disable=too-many-locals
|
def update_result(self, context): # pylint: disable=too-many-locals
|
||||||
if not self.raw_output:
|
if not self.raw_output:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user