#NEWLINE# @ logging . log_task_wrapper ( LOG . info , _ ( 'Benchmarking.' ) ) #NEWLINE# def run( self ) : #NEWLINE# #INDENT# 'Run the benchmark according to the test configuration.\n\n        Test configuration is specified on engine initialization.\n\n        :returns: List of dicts, each dict containing the results of all the\n                  corresponding benchmark test launches\n        ' #NEWLINE# self . task . update_status ( consts . TaskStatus . RUNNING ) #NEWLINE# for subtask in self . config . subtasks : #NEWLINE# #INDENT# for ( pos , workload ) in enumerate ( subtask . workloads ) : #NEWLINE# #INDENT# if ResultConsumer . is_task_in_aborting_status ( self . task [ 'uuid' ] ) : #NEWLINE# #INDENT# LOG . info ( 'Received aborting signal.' ) #NEWLINE# self . task . update_status ( consts . TaskStatus . ABORTED ) #NEWLINE# return #NEWLINE# #UNINDENT# key = workload . make_key ( pos ) #NEWLINE# LOG . info ( ( 'Running benchmark with key: \n%s' % json . dumps ( key , indent = 2 ) ) ) #NEWLINE# runner_obj = self . _get_runner ( workload . runner ) #NEWLINE# context_obj = self . _prepare_context ( workload . context , workload . name , self . admin ) #NEWLINE# try : #NEWLINE# #INDENT# with ResultConsumer ( key , self . task , runner_obj , self . abort_on_sla_failure ) : #NEWLINE# #INDENT# with context . ContextManager ( context_obj ) : #NEWLINE# #INDENT# runner_obj . run ( context_obj . name , context_obj , workload . args ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# except Exception as e : #NEWLINE# #INDENT# LOG . exception ( e ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# if ( objects . Task . get_status ( self . task [ 'uuid' ] ) != consts . TaskStatus . ABORTED ) : #NEWLINE# #INDENT# self . task . update_status ( consts . TaskStatus . FINISHED )