mirror of
				https://github.com/ARM-software/workload-automation.git
				synced 2025-11-04 09:02:12 +00: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.framework.exception import WorkloadError, ResourceError
 | 
			
		||||
from wa.utils.misc import check_output
 | 
			
		||||
from wa.utils.exec_control import once
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
RAW_OUTPUT_FILENAME = 'raw-output.txt'
 | 
			
		||||
TARBALL_FILENAME = 'rtapp-logs.tar.gz'
 | 
			
		||||
@@ -145,6 +147,7 @@ class RtApp(Workload):
 | 
			
		||||
                  """),
 | 
			
		||||
    ]
 | 
			
		||||
 | 
			
		||||
    @once
 | 
			
		||||
    def initialize(self, context):
 | 
			
		||||
        # initialize() runs once per run. setting a class variable to make it
 | 
			
		||||
        # 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('crit_count', crit_count, 'count')
 | 
			
		||||
 | 
			
		||||
    @once
 | 
			
		||||
    def finalize(self, context):
 | 
			
		||||
        if self.uninstall_on_exit:
 | 
			
		||||
            self.target.uninstall(self.target_binary)
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user