Skip to content

Commit cc21386

Browse files
committed
[kernel|test|gen-tcp-misc] Tweaked send_timeout_resume tc
1 parent d34bf8c commit cc21386

File tree

1 file changed

+17
-5
lines changed

1 file changed

+17
-5
lines changed

lib/kernel/test/gen_tcp_misc_SUITE.erl

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6047,6 +6047,21 @@ timeout_sink_loop(Action, To, N) ->
60476047

60486048
send_timeout_resume(Config) when is_list(Config) ->
60496049
ct:timetrap(?SECS(16)),
6050+
Cond = fun() ->
6051+
case ?IS_SOCKET_BACKEND(Config) of
6052+
true ->
6053+
{skip, "Unstable with 'socket' backend"};
6054+
false ->
6055+
Key = kernel_factor,
6056+
case lists:keysearch(Key, 1, Config) of
6057+
{value, {Key, Factor}} when (Factor > 6) ->
6058+
{skip,
6059+
?F("Too slow (factor = ~w)", [Factor])};
6060+
_ ->
6061+
ok
6062+
end
6063+
end
6064+
end,
60506065
Pre = fun() ->
60516066
Dir = filename:dirname(code:which(?MODULE)),
60526067
?P("create node"),
@@ -6058,7 +6073,7 @@ send_timeout_resume(Config) when is_list(Config) ->
60586073
?P("stop node ~p", [Node]),
60596074
?STOP_NODE(Node)
60606075
end,
6061-
?TC_TRY(?FUNCTION_NAME, Pre, Case, Post).
6076+
?TC_TRY(?FUNCTION_NAME, Cond, Pre, Case, Post).
60626077

60636078
do_send_timeout_resume(Config, RNode, BlockPow) ->
60646079
BlockSize = 1 bsl BlockPow,
@@ -6133,10 +6148,7 @@ do_send_timeout_resume(Config, RNode, BlockPow) ->
61336148
?P("count checked out"),
61346149
ok;
61356150
{Tag, ok, Count} when Count =:= N * BlockSize ->
6136-
?P("Unexpected number of timeouts, ~w, when"
6137-
"~n Expected count: ~p"
6138-
"~n Got count: ~p"
6139-
"~n ", [Timeouts, N*BlockSize, Count]),
6151+
?P("Unexpected number of timeouts: ~w", [Timeouts]),
61406152
ct:fail(Result);
61416153
{Tag, ok, Count} ->
61426154
?P("Unexpected counts: "

0 commit comments

Comments
 (0)