mirror of
https://github.com/ARM-software/workload-automation.git
synced 2025-09-02 11:22:41 +01:00
workloads/rt-app: only initialize once
Only initialize/finalize once per run to avoid reinstalling the binary and recreating the working directory needlessly.
This commit is contained in:
committed by
Marc Bonnici
parent
eacc319239
commit
d20422ac15
@@ -23,6 +23,8 @@ from subprocess import CalledProcessError
|
|||||||
from wa import Workload, Parameter, Executable, File
|
from wa import Workload, Parameter, Executable, File
|
||||||
from wa.framework.exception import WorkloadError, ResourceError
|
from wa.framework.exception import WorkloadError, ResourceError
|
||||||
from wa.utils.misc import check_output
|
from wa.utils.misc import check_output
|
||||||
|
from wa.utils.exec_control import once
|
||||||
|
|
||||||
|
|
||||||
RAW_OUTPUT_FILENAME = 'raw-output.txt'
|
RAW_OUTPUT_FILENAME = 'raw-output.txt'
|
||||||
TARBALL_FILENAME = 'rtapp-logs.tar.gz'
|
TARBALL_FILENAME = 'rtapp-logs.tar.gz'
|
||||||
@@ -145,6 +147,7 @@ class RtApp(Workload):
|
|||||||
"""),
|
"""),
|
||||||
]
|
]
|
||||||
|
|
||||||
|
@once
|
||||||
def initialize(self, context):
|
def initialize(self, context):
|
||||||
# initialize() runs once per run. setting a class variable to make it
|
# initialize() runs once per run. setting a class variable to make it
|
||||||
# available to other instances of the workload
|
# available to other instances of the workload
|
||||||
@@ -209,6 +212,7 @@ class RtApp(Workload):
|
|||||||
context.add_metric('error_count', error_count, 'count')
|
context.add_metric('error_count', error_count, 'count')
|
||||||
context.add_metric('crit_count', crit_count, 'count')
|
context.add_metric('crit_count', crit_count, 'count')
|
||||||
|
|
||||||
|
@once
|
||||||
def finalize(self, context):
|
def finalize(self, context):
|
||||||
if self.uninstall_on_exit:
|
if self.uninstall_on_exit:
|
||||||
self.target.uninstall(self.target_binary)
|
self.target.uninstall(self.target_binary)
|
||||||
|
Reference in New Issue
Block a user