From c066aff48cb1c29b2e06cc5144fc32ef5bf2f22c Mon Sep 17 00:00:00 2001 From: Peter Andersson Date: Wed, 14 Mar 2012 00:38:28 +0100 Subject: Set correct group leader for end_per_testcase process after tc timeout Also make sure that warnings about failure or timeout of end_per_testcase (after a test case timeout) get printed in the test case log file. OTP-9666 --- lib/common_test/test/ct_error_SUITE.erl | 6 +++++- .../ct_error_SUITE_data/error/test/timetrap_1_SUITE.erl | 15 ++++++++++++++- 2 files changed, 19 insertions(+), 2 deletions(-) (limited to 'lib/common_test') diff --git a/lib/common_test/test/ct_error_SUITE.erl b/lib/common_test/test/ct_error_SUITE.erl index 053edba846..79ed51bc28 100644 --- a/lib/common_test/test/ct_error_SUITE.erl +++ b/lib/common_test/test/ct_error_SUITE.erl @@ -700,7 +700,7 @@ test_events(timetrap_end_conf) -> [ {?eh,start_logging,{'DEF','RUNDIR'}}, {?eh,test_start,{'DEF',{'START_TIME','LOGDIR'}}}, - {?eh,start_info,{1,1,8}}, + {?eh,start_info,{1,1,9}}, {?eh,tc_start,{timetrap_1_SUITE,init_per_suite}}, {?eh,tc_done,{timetrap_1_SUITE,init_per_suite,ok}}, {?eh,tc_start,{timetrap_1_SUITE,tc1}}, @@ -735,6 +735,10 @@ test_events(timetrap_end_conf) -> {?eh,tc_done, {timetrap_1_SUITE,tc8,{failed,{timetrap_timeout,1000}}}}, {?eh,test_stats,{0,8,{0,0}}}, + {?eh,tc_start,{timetrap_1_SUITE,tc9}}, + {?eh,tc_done, + {timetrap_1_SUITE,tc9,{failed,{timetrap_timeout,1000}}}}, + {?eh,test_stats,{0,9,{0,0}}}, {?eh,tc_start,{timetrap_1_SUITE,end_per_suite}}, {?eh,tc_done,{timetrap_1_SUITE,end_per_suite,ok}}, {?eh,test_done,{'DEF','STOP_TIME'}}, diff --git a/lib/common_test/test/ct_error_SUITE_data/error/test/timetrap_1_SUITE.erl b/lib/common_test/test/ct_error_SUITE_data/error/test/timetrap_1_SUITE.erl index faa0a7305c..a44ff6d0bc 100644 --- a/lib/common_test/test/ct_error_SUITE_data/error/test/timetrap_1_SUITE.erl +++ b/lib/common_test/test/ct_error_SUITE_data/error/test/timetrap_1_SUITE.erl @@ -145,8 +145,17 @@ end_per_testcase1(tc8, Config) -> ct:pal("end_per_testcase(tc8): ~p", [Config]), tc8 = ?config(tc, Config), {failed,timetrap_timeout} = ?config(tc_status, Config), + ok; + +end_per_testcase1(tc9, Config) -> + ct:pal("end_per_testcase(tc9): ~p", [Config]), + tc9 = ?config(tc, Config), + %% check that it's possible to send and receive synchronously + %% with the group leader process for end_per_testcase + test_server:stop_node(dummy@somehost), ok. + %%-------------------------------------------------------------------- %% Function: groups() -> [Group] %% Group = {GroupName,Properties,GroupsAndTestCases} @@ -170,7 +179,7 @@ groups() -> %% Reason = term() %%-------------------------------------------------------------------- all() -> - [tc1, tc2, tc3, tc4, tc5, tc6, tc7, tc8]. + [tc1, tc2, tc3, tc4, tc5, tc6, tc7, tc8, tc9]. tc1(_) -> timer:sleep(2000), @@ -205,6 +214,10 @@ tc8(_) -> timetrap_helper:sleep(2000), ok. +tc9(_) -> + sleep(2000), + ok. + %%%----------------------------------------------------------------- sleep(T) -> timer:sleep(T), -- cgit v1.2.3