@@ -596,29 +596,37 @@ def call_api(self, test, service, qube):
596596 start_time = get_time ()
597597 app = qubesadmin .Qubes ()
598598 domains = app .domains
599+ target_time = None
600+ startup_time = None
599601 if test .non_dispvm :
600602 # Even though we already have the qube object passed from the
601603 # class, assume we don't so we can calculate gathering.
602604 target_qube = domains [self .vm1 .name ]
603605 domain_time = get_time ()
606+ pre_exec_time = domain_time
604607 else :
605608 appvm = domains [qube ]
606609 domain_time = get_time ()
607610 target_wrapper = qubesadmin .vm .DispVM .from_appvm (app , appvm )
608611 target_qube = target_wrapper .create_disposable ()
609- name = target_qube .name
610- # A very small number, if it appears, it will show a bottleneck at
611- # DispVM.from_appvm.
612- target_time = get_time ()
612+ target_time = get_time ()
613+ if not test .preload_max :
614+ target_qube .start ()
615+ startup_time = get_time ()
616+ pre_exec_time = startup_time
617+ else :
618+ pre_exec_time = startup_time
613619 try :
614620 target_qube .run_service_for_stdio (service , timeout = 60 )
615621 except subprocess .CalledProcessError as e :
622+ name = target_qube .name
616623 raise Exception (
617624 f"'{ name } ': service '{ service } ' failed ({ e .returncode } ):"
618625 f" { e .stdout } ,"
619626 f" { e .stderr } "
620627 )
621628 except subprocess .TimeoutExpired as e :
629+ name = target_qube .name
622630 raise Exception (
623631 f"'{ name } ': service '{ service } ' failed: timeout expired:"
624632 f" { e .stdout } ,"
@@ -635,7 +643,13 @@ def call_api(self, test, service, qube):
635643 runtime ["dom" ] = round (domain_time - start_time , ROUND_PRECISION )
636644 if not test .non_dispvm :
637645 runtime ["disp" ] = round (target_time - domain_time , ROUND_PRECISION )
638- runtime ["exec" ] = round (run_service_time - target_time , ROUND_PRECISION )
646+ if not test .preload_max :
647+ runtime ["start" ] = round (
648+ startup_time - target_time , ROUND_PRECISION
649+ )
650+ runtime ["exec" ] = round (
651+ run_service_time - pre_exec_time , ROUND_PRECISION
652+ )
639653 if not test .non_dispvm :
640654 runtime ["clean" ] = round (
641655 cleanup_time - run_service_time , ROUND_PRECISION
0 commit comments