From a5c108b7eed9badc3b0ea0b4bad3af4bf36bc55b Mon Sep 17 00:00:00 2001 From: Peter Andersson Date: Fri, 23 Aug 2013 15:18:22 +0200 Subject: Fix problem with start order of hooks and stopping of ct_util_server --- lib/common_test/src/ct_hooks.erl | 2 +- lib/common_test/src/ct_logs.erl | 4 ++-- lib/common_test/src/ct_util.erl | 10 ++++++++-- 3 files changed, 11 insertions(+), 5 deletions(-) (limited to 'lib') diff --git a/lib/common_test/src/ct_hooks.erl b/lib/common_test/src/ct_hooks.erl index 3d87a82e24..b492663c57 100644 --- a/lib/common_test/src/ct_hooks.erl +++ b/lib/common_test/src/ct_hooks.erl @@ -50,7 +50,7 @@ -spec init(State :: term()) -> ok | {fail, Reason :: term()}. init(Opts) -> - call(get_new_hooks(Opts, undefined) ++ get_builtin_hooks(Opts), + call(get_builtin_hooks(Opts) ++ get_new_hooks(Opts, undefined), ok, init, []). diff --git a/lib/common_test/src/ct_logs.erl b/lib/common_test/src/ct_logs.erl index 08a7fcb831..4cc1564570 100644 --- a/lib/common_test/src/ct_logs.erl +++ b/lib/common_test/src/ct_logs.erl @@ -641,8 +641,8 @@ logger(Parent, Mode, Verbosity) -> "\n
\n"]),
     MiscIoDivider =
 	"\n\n"++
-	xhtml("
\n

Post-test Log

\n
\n",
-	      "
\n

\n

POST-TEST LOG

\n
\n"),
+	xhtml("
\n

Post-test Log

\n
\n",
+	      "
\n
\n

POST-TEST LOG

\n
\n"),
     ct_util:set_testdata_async({misc_io_log,{filename:absname(MiscIoName),
 					     MiscIoDivider,MiscIoFooter}}),
 
diff --git a/lib/common_test/src/ct_util.erl b/lib/common_test/src/ct_util.erl
index e039f68121..cbdf999cf8 100644
--- a/lib/common_test/src/ct_util.erl
+++ b/lib/common_test/src/ct_util.erl
@@ -693,8 +693,14 @@ reset_silent_connections() ->
 %%% @see ct
 stop(Info) ->
     case whereis(ct_util_server) of
-	undefined -> ok;
-	_ -> call({stop,Info})
+	undefined -> 
+	    ok;
+	CtUtilPid ->
+	    Ref = monitor(process, CtUtilPid),
+	    call({stop,Info}),
+	    receive
+		{'DOWN',Ref,_,_,_} -> ok
+	    end
     end.
 
 %%%-----------------------------------------------------------------
-- 
cgit v1.2.3