diff options
author | Siri Hansen <[email protected]> | 2012-11-19 10:08:05 +0100 |
---|---|---|
committer | Siri Hansen <[email protected]> | 2012-11-19 10:08:05 +0100 |
commit | 22e6663608240c3f7beb41fd4e76975f9c490017 (patch) | |
tree | 6792a054d622eccab9c9a0f5721db89431aa71ff /lib/test_server/src | |
parent | 05bb9fa2116d568b4f47b171abfbfdc73ec518e1 (diff) | |
parent | 1a8e644f07418f27fad173201381012cb827282f (diff) | |
download | otp-22e6663608240c3f7beb41fd4e76975f9c490017.tar.gz otp-22e6663608240c3f7beb41fd4e76975f9c490017.tar.bz2 otp-22e6663608240c3f7beb41fd4e76975f9c490017.zip |
Merge branch 'siri/test_server/break-in-end_per_testcase/OTP-10046'
* siri/test_server/break-in-end_per_testcase/OTP-10046:
[test_server] Cancel timetrap for break in end_per_testcase
Diffstat (limited to 'lib/test_server/src')
-rw-r--r-- | lib/test_server/src/test_server.erl | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/lib/test_server/src/test_server.erl b/lib/test_server/src/test_server.erl index 1d3394e0ca..14cdfd391a 100644 --- a/lib/test_server/src/test_server.erl +++ b/lib/test_server/src/test_server.erl @@ -724,9 +724,11 @@ call_end_conf(Mod,Func,TCPid,TCExitReason,Loc,Conf,TVal) -> Data = {Mod,Func,TCPid,TCExitReason,Loc}, EndConfProc = fun() -> + process_flag(trap_exit,true), % to catch timetraps Supervisor = self(), EndConfApply = fun() -> + timetrap(TVal), case catch apply(Mod,end_per_testcase,[Func,Conf]) of {'EXIT',Why} -> timer:sleep(1), @@ -745,14 +747,14 @@ call_end_conf(Mod,Func,TCPid,TCExitReason,Loc,Conf,TVal) -> {Pid,end_conf} -> Starter ! {self(),{call_end_conf,Data,ok}}; {'EXIT',Pid,Reason} -> - Starter ! {self(),{call_end_conf,Data,{error,Reason}}} - after TVal -> - exit(Pid, kill), group_leader() ! {printout,12, "WARNING! ~p:end_per_testcase(~p, ~p)" - " failed!\n\tReason: timetrap timeout" - " after ~w ms!\n", [Mod,Func,Conf,TVal]}, - Starter ! {self(),{call_end_conf,Data,{error,timeout}}} + " failed!\n\tReason: ~p\n", + [Mod,Func,Conf,Reason]}, + Starter ! {self(),{call_end_conf,Data,{error,Reason}}}; + {'EXIT',_OtherPid,Reason} -> + %% Probably the parent - not much to do about that + exit(Reason) end end, spawn_link(EndConfProc). |