aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPeter Andersson <[email protected]>2013-08-23 15:18:22 +0200
committerPeter Andersson <[email protected]>2013-09-02 12:14:01 +0200
commita5c108b7eed9badc3b0ea0b4bad3af4bf36bc55b (patch)
treed7649e79683998dd043e19422583e916da7a56ef
parent614ba49d9ff9c75466bc3bba5b25a2e583e09217 (diff)
downloadotp-a5c108b7eed9badc3b0ea0b4bad3af4bf36bc55b.tar.gz
otp-a5c108b7eed9badc3b0ea0b4bad3af4bf36bc55b.tar.bz2
otp-a5c108b7eed9badc3b0ea0b4bad3af4bf36bc55b.zip
Fix problem with start order of hooks and stopping of ct_util_server
-rw-r--r--lib/common_test/src/ct_hooks.erl2
-rw-r--r--lib/common_test/src/ct_logs.erl4
-rw-r--r--lib/common_test/src/ct_util.erl10
3 files changed, 11 insertions, 5 deletions
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<pre>\n"]),
MiscIoDivider =
"\n<a name=\"posttest\"></a>\n"++
- xhtml("</pre>\n<br><br><h2>Post-test Log</h2>\n<pre>\n",
- "</pre>\n<br /><br />\n<h3>POST-TEST LOG</h3>\n<pre>\n"),
+ xhtml("</pre>\n<br><h2>Post-test Log</h2>\n<pre>\n",
+ "</pre>\n<br />\n<h3>POST-TEST LOG</h3>\n<pre>\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.
%%%-----------------------------------------------------------------