aboutsummaryrefslogtreecommitdiffstats
path: root/lib/kernel/test/logger_std_h_SUITE.erl
diff options
context:
space:
mode:
authorSiri Hansen <[email protected]>2018-06-14 15:19:50 +0200
committerSiri Hansen <[email protected]>2018-06-15 11:13:45 +0200
commit1a07345694834bcb68ca2f27d2dc940e0f036f9c (patch)
tree1e3283328cf60912f129ecd8a12babeb0f445b8e /lib/kernel/test/logger_std_h_SUITE.erl
parent40f29ea1f77dec1cc4920b3593091b35b597f8ff (diff)
downloadotp-1a07345694834bcb68ca2f27d2dc940e0f036f9c.tar.gz
otp-1a07345694834bcb68ca2f27d2dc940e0f036f9c.tar.bz2
otp-1a07345694834bcb68ca2f27d2dc940e0f036f9c.zip
[logger] Adjust priority settings in test
Now only setting high priority on every second burst sending process, to allow for handler process to be scheduled in every now and then.
Diffstat (limited to 'lib/kernel/test/logger_std_h_SUITE.erl')
-rw-r--r--lib/kernel/test/logger_std_h_SUITE.erl18
1 files changed, 12 insertions, 6 deletions
diff --git a/lib/kernel/test/logger_std_h_SUITE.erl b/lib/kernel/test/logger_std_h_SUITE.erl
index c2cc7653ea..76f8a35406 100644
--- a/lib/kernel/test/logger_std_h_SUITE.erl
+++ b/lib/kernel/test/logger_std_h_SUITE.erl
@@ -1257,13 +1257,9 @@ send_n_burst(N, seq, Text, Class) ->
send_n_burst(N-1, seq, Text, Class);
send_n_burst(N, {spawn,Ps,TO}, Text, Class) ->
ct:pal("~w processes each sending ~w messages", [Ps,N]),
- PerProc = fun() ->
- process_flag(priority,high),
- send_n_burst(N, seq, Text, Class)
- end,
MRefs = [begin if TO == 0 -> ok; true -> timer:sleep(TO) end,
- monitor(process,spawn_link(PerProc)) end ||
- _ <- lists:seq(1,Ps)],
+ monitor(process,spawn_link(per_proc_fun(N,Text,Class,X)))
+ end || X <- lists:seq(1,Ps)],
lists:foreach(fun(MRef) ->
receive
{'DOWN', MRef, _, _, _} ->
@@ -1282,6 +1278,16 @@ send_t_burst(T0, T, Text, Class, N) ->
send_t_burst(T0, T, Text, Class, N+1)
end.
+per_proc_fun(N,Text,Class,X) when X rem 2 == 0 ->
+ fun() ->
+ process_flag(priority,high),
+ send_n_burst(N, seq, Text, Class)
+ end;
+per_proc_fun(N,Text,Class,_) ->
+ fun() ->
+ send_n_burst(N, seq, Text, Class)
+ end.
+
%%%-----------------------------------------------------------------
%%% Formatter callback
%%% Using this to send the formatted string back to the test case