@@ -452,6 +452,9 @@ def utask_main(uworker_input: uworker_msg_pb2.Input): # pylint: disable=no-memb
452452 warmup_timeout = environment .get_value ('WARMUP_TIMEOUT' )
453453 required_arguments = environment .get_value ('REQUIRED_APP_ARGS' , '' )
454454
455+ logs .info ('Warming up for minimization, checking for crashes ' +
456+ f'(thread count: { max_threads } ).' )
457+
455458 # Add any testcase-specific required arguments if needed.
456459 additional_required_arguments = testcase .get_metadata (
457460 'additional_required_app_args' )
@@ -474,6 +477,7 @@ def utask_main(uworker_input: uworker_msg_pb2.Input): # pylint: disable=no-memb
474477
475478 saved_unsymbolized_crash_state , flaky_stack , crash_times = (
476479 check_for_initial_crash (test_runner , crash_retries , testcase ))
480+ logs .info (f'Warmup crashed { crash_times } /{ crash_retries } times.' )
477481
478482 # If the warmup crash occurred but we couldn't reproduce this in with
479483 # multiple processes running in parallel, try to minimize single threaded.
@@ -490,6 +494,7 @@ def utask_main(uworker_input: uworker_msg_pb2.Input): # pylint: disable=no-memb
490494
491495 saved_unsymbolized_crash_state , flaky_stack , crash_times = (
492496 check_for_initial_crash (test_runner , crash_retries , testcase ))
497+ logs .info (f'Single-threaded warmup crashed { crash_times } times.' )
493498
494499 if not crash_times :
495500 # We didn't crash at all. This might be a legitimately unreproducible
@@ -519,12 +524,13 @@ def utask_main(uworker_input: uworker_msg_pb2.Input): # pylint: disable=no-memb
519524
520525 # Use the max crash time unless this would be greater than the max timeout.
521526 test_timeout = min (max (crash_times ), max_timeout ) + 1
522- logs .info (f'Using timeout { test_timeout } (was { max_timeout } )' )
527+ logs .info (f'Using per-test timeout { test_timeout } (was { max_timeout } )' )
523528 test_runner .timeout = test_timeout
524529
525- logs .info ('Starting minimization.' )
530+ logs .info (f 'Starting minimization with overall { deadline } s timeout .' )
526531
527532 if should_attempt_phase (testcase , MinimizationPhase .GESTURES ):
533+ logs .info ('Starting gesture minimization phase.' )
528534 gestures = minimize_gestures (test_runner , testcase )
529535
530536 # We can't call check_deadline_exceeded_and_store_partial_minimized_testcase
@@ -547,39 +553,51 @@ def utask_main(uworker_input: uworker_msg_pb2.Input): # pylint: disable=no-memb
547553 minimize_task_output .minimization_phase = MinimizationPhase .MAIN_FILE
548554
549555 if time .time () > test_runner .deadline :
556+ logs .info ('Timed out during gesture minimization.' )
550557 return uworker_msg_pb2 .Output ( # pylint: disable=no-member
551558 minimize_task_output = minimize_task_output ,
552559 error_type = uworker_msg_pb2 .ErrorType . # pylint: disable=no-member
553- MINIMIZE_DEADLINE_EXCEEDED_IN_MAIN_FILE_PHASE )
560+ MINIMIZE_DEADLINE_EXCEEDED_IN_MAIN_FILE_PHASE ,
561+ error_message = 'Timed out during gesture minimization.' )
562+
563+ logs .info ('Minimized gestures.' )
554564
555565 # Minimize the main file.
556566 data = utils .get_file_contents_with_fatal_error_on_failure (testcase_file_path )
557567 if should_attempt_phase (testcase , MinimizationPhase .MAIN_FILE ):
568+ logs .info ('Starting main file minimization phase.' )
558569 data = minimize_main_file (test_runner , testcase_file_path , data )
559570
560571 if check_deadline_exceeded_and_store_partial_minimized_testcase (
561572 deadline , testcase , input_directory , file_list , data ,
562573 testcase_file_path , minimize_task_input , minimize_task_output ):
574+ logs .info ('Timed out during main file minimization.' )
563575 return uworker_msg_pb2 .Output ( # pylint: disable=no-member
564576 error_type = uworker_msg_pb2 .ErrorType .MINIMIZE_DEADLINE_EXCEEDED , # pylint: disable=no-member
577+ error_message = 'Timed out during main file minimization.' ,
565578 minimize_task_output = minimize_task_output )
566579
580+ logs .info ('Minimized main file.' )
567581 testcase .set_metadata ('minimization_phase' , MinimizationPhase .FILE_LIST ,
568582 False )
569583 minimize_task_output .minimization_phase = MinimizationPhase .FILE_LIST
570584
571585 # Minimize the file list.
572586 if should_attempt_phase (testcase , MinimizationPhase .FILE_LIST ):
573587 if environment .get_value ('MINIMIZE_FILE_LIST' , True ):
588+ logs .info ('Starting file list minimization phase.' )
574589 file_list = minimize_file_list (test_runner , file_list , input_directory ,
575590 testcase_file_path )
576591
577592 if check_deadline_exceeded_and_store_partial_minimized_testcase (
578593 deadline , testcase , input_directory , file_list , data ,
579594 testcase_file_path , minimize_task_input , minimize_task_output ):
595+ logs .info ('Timed out during file list minimization.' )
580596 return uworker_msg_pb2 .Output ( # pylint: disable=no-member
581597 error_type = uworker_msg_pb2 .ErrorType .MINIMIZE_DEADLINE_EXCEEDED , # pylint: disable=no-member
598+ error_message = 'Timed out during file list minimization.' ,
582599 minimize_task_output = minimize_task_output )
600+ logs .info ('Minimized file list.' )
583601 else :
584602 logs .info ('Skipping minimization of file list.' )
585603
@@ -590,16 +608,21 @@ def utask_main(uworker_input: uworker_msg_pb2.Input): # pylint: disable=no-memb
590608 # Minimize any files remaining in the file list.
591609 if should_attempt_phase (testcase , MinimizationPhase .RESOURCES ):
592610 if environment .get_value ('MINIMIZE_RESOURCES' , True ):
611+ logs .info ('Starting resources minimization phase.' )
593612 for dependency in file_list :
594613 minimize_resource (test_runner , dependency , input_directory ,
595614 testcase_file_path )
596615
597616 if check_deadline_exceeded_and_store_partial_minimized_testcase (
598617 deadline , testcase , input_directory , file_list , data ,
599618 testcase_file_path , minimize_task_input , minimize_task_output ):
619+ logs .info ('Timed out during resources minimization.' )
600620 return uworker_msg_pb2 .Output ( # pylint: disable=no-member
601621 error_type = uworker_msg_pb2 .ErrorType .MINIMIZE_DEADLINE_EXCEEDED , # pylint: disable=no-member
622+ error_message = 'Timed out during resources minimization.' ,
602623 minimize_task_output = minimize_task_output )
624+
625+ logs .info ('Minimized resources.' )
603626 else :
604627 logs .info ('Skipping minimization of resources.' )
605628
@@ -608,6 +631,7 @@ def utask_main(uworker_input: uworker_msg_pb2.Input): # pylint: disable=no-memb
608631 minimize_task_output .minimization_phase = MinimizationPhase .ARGUMENTS
609632
610633 if should_attempt_phase (testcase , MinimizationPhase .ARGUMENTS ):
634+ logs .info ('Starting arguments minimization phase.' )
611635 app_arguments = minimize_arguments (test_runner , app_arguments )
612636
613637 # Arguments must be stored here in case we time out below.
@@ -617,10 +641,16 @@ def utask_main(uworker_input: uworker_msg_pb2.Input): # pylint: disable=no-memb
617641 if check_deadline_exceeded_and_store_partial_minimized_testcase (
618642 deadline , testcase , input_directory , file_list , data ,
619643 testcase_file_path , minimize_task_input , minimize_task_output ):
644+ logs .info ('Timed out during arguments minimization.' )
620645 return uworker_msg_pb2 .Output ( # pylint: disable=no-member
621646 error_type = uworker_msg_pb2 .ErrorType .MINIMIZE_DEADLINE_EXCEEDED , # pylint: disable=no-member
647+ error_message = 'Timed out during arguments minimization.' ,
622648 minimize_task_output = minimize_task_output )
623649
650+ logs .info ('Minimized arguments.' )
651+
652+ logs .info ('Finished minization.' )
653+
624654 command = testcase_manager .get_command_line_for_application (
625655 testcase_file_path , app_args = app_arguments , needs_http = testcase .http_flag )
626656 last_crash_result = test_runner .last_failing_result
@@ -748,6 +778,10 @@ def handle_minimize_crash_too_flaky(output):
748778def handle_minimize_deadline_exceeded_in_main_file_phase (output ):
749779 """Reschedules the minimize task when the deadline is exceeded just before
750780 starting the main file phase."""
781+ testcase = data_handler .get_testcase_by_id (output .uworker_input .testcase_id )
782+ data_handler .update_testcase_comment (
783+ testcase , data_types .TaskState .WIP ,
784+ 'Timed out before even minimizing the main file. Retrying.' )
751785 tasks .add_task ('minimize' , output .uworker_input .testcase_id ,
752786 output .uworker_input .job_type )
753787
@@ -762,6 +796,9 @@ def handle_minimize_deadline_exceeded(output: uworker_msg_pb2.Output): # pylint
762796 _skip_minimization (testcase ,
763797 'Exceeded minimization deadline too many times.' )
764798 else :
799+ data_handler .update_testcase_comment (
800+ testcase , data_types .TaskState .WIP ,
801+ output .error_message + f' Retrying (attempt #{ attempts + 1 } ).' )
765802 testcase .set_metadata ('minimization_deadline_exceeded_attempts' ,
766803 attempts + 1 )
767804 tasks .add_task ('minimize' , output .uworker_input .testcase_id ,
0 commit comments