aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnders Svensson <[email protected]>2017-08-17 00:53:36 +0200
committerAnders Svensson <[email protected]>2017-08-17 12:23:41 +0200
commitd8d3c2a36045bcbe2ae5fd8f08b30a5d103f7bac (patch)
tree008b27f701680f73d00f7760d0a627212afbbade
parenta73254692913e689aedf1154c0ee378546502501 (diff)
downloadotp-d8d3c2a36045bcbe2ae5fd8f08b30a5d103f7bac.tar.gz
otp-d8d3c2a36045bcbe2ae5fd8f08b30a5d103f7bac.tar.bz2
otp-d8d3c2a36045bcbe2ae5fd8f08b30a5d103f7bac.zip
Work around unexpected common_test behaviour
diameter_traffic_SUITE has four layers of nested groups, so when a testcase is run it should get Config from four init_per_group plus one init_per_testcase. This isn't what happens: Config is being accumulated from several init_per_group in some manner that isn't clear, and the skip in the parent commit somehow results in growing test_server_gl:init/1 processes that eventually consume all memory. Replacing rather than prepending to Config in init_per_group works around this, but the common_test behaviour seems wrong.
-rw-r--r--lib/diameter/test/diameter_traffic_SUITE.erl13
1 files changed, 11 insertions, 2 deletions
diff --git a/lib/diameter/test/diameter_traffic_SUITE.erl b/lib/diameter/test/diameter_traffic_SUITE.erl
index fde7e9b8c2..a2c0f7fae6 100644
--- a/lib/diameter/test/diameter_traffic_SUITE.erl
+++ b/lib/diameter/test/diameter_traffic_SUITE.erl
@@ -325,7 +325,7 @@ init_per_group(Name, Config)
false ->
start_services(Config),
add_transports(Config),
- [{sleep, Name == parallel} | Config]
+ replace({sleep, Name == parallel}, Config)
end;
init_per_group(sctp = Name, Config) ->
@@ -352,7 +352,7 @@ init_per_group(Name, Config) ->
server_decoding = D,
server_sender = SS,
server_throttle = ST},
- [{group, G}, {runlist, select()} | Config];
+ replace([{group, G}, {runlist, select()}], Config);
_ ->
Config
end.
@@ -396,6 +396,15 @@ init_per_testcase(Name, Config) ->
end_per_testcase(_, _) ->
ok.
+%% replace/2
+
+replace(Pairs, Config)
+ when is_list(Pairs) ->
+ lists:foldl(fun replace/2, Config, Pairs);
+
+replace({Key, _} = T, Config) ->
+ [T | lists:keydelete(Key, 1, Config)].
+
%% --------------------
%% Testcases to run when services are started and connections