@@ -62,12 +62,13 @@ main(RawArgs) ->
6262 timer :sleep (50 ),
6363 CTRunDirsAfterRun = ct_run_dirs (),
6464 inject_error_report_link (CTRunDirsBeforeRun , CTRunDirsAfterRun ),
65+ ErrorLimitExceeded = check_error_limit_exceeded (CTRunDirsBeforeRun , CTRunDirsAfterRun ),
6566 ExitStatusByGroups = exit_status_by_groups (CTRunDirsBeforeRun , CTRunDirsAfterRun , Results ),
6667 ExitStatusByTestCases = process_results (Results ),
67- case ExitStatusByGroups of
68+ ExitStatus = case ExitStatusByGroups of
6869 undefined ->
6970 io :format (" Exiting by test cases summary: ~p~n " , [ExitStatusByTestCases ]),
70- init : stop ( ExitStatusByTestCases ) ;
71+ ExitStatusByTestCases ;
7172 _ when is_integer (ExitStatusByGroups ) ->
7273 % % FIXME: This is incorrect assumption, it ignores results of all individual
7374 % % tests cases and groups w/o 'repeat_until_all_ok' flag. So we can return
@@ -76,8 +77,17 @@ main(RawArgs) ->
7677 % % may result in squashing ct output, since execution of run_common_test.erl
7778 % % is wrapped using silent_exec.sh tool.
7879 io :format (" Exiting by groups summary: ~p~n " , [ExitStatusByGroups ]),
79- init :stop (ExitStatusByGroups )
80- end
80+ ExitStatusByGroups
81+ end ,
82+ FinalStatus = case {ExitStatus , ErrorLimitExceeded } of
83+ {0 , {true , Details }} ->
84+ io :format (" ~n **** Failing due to unexpected error"
85+ " log limit exceeded:~n~s " , [Details ]),
86+ 1 ;
87+ _ ->
88+ ExitStatus
89+ end ,
90+ init :stop (FinalStatus )
8191 catch Type :Reason :StackTrace ->
8292 io :format (" TEST CRASHED~n Error type: ~p~n Reason: ~p~n Stacktrace:~n~p~n " ,
8393 [Type , Reason , StackTrace ]),
@@ -683,6 +693,20 @@ handle_file_error(_FileName, Other) ->
683693ct_run_dirs () ->
684694 filelib :wildcard (" ct_report/ct_run*" ).
685695
696+ check_error_limit_exceeded (Before , After ) ->
697+ case After -- Before of
698+ [RunDir ] ->
699+ Marker = filename :join ([RunDir , " logged_errors" , " limit_exceeded" ]),
700+ case file :read_file (Marker ) of
701+ {ok , Content } ->
702+ {true , Content };
703+ _ ->
704+ false
705+ end ;
706+ _ ->
707+ false
708+ end .
709+
686710inject_error_report_link (Before , After ) ->
687711 case After -- Before of
688712 [RunDir ] ->
0 commit comments