aboutsummaryrefslogtreecommitdiffstats
path: root/lib/diameter
diff options
context:
space:
mode:
authorAnders Svensson <[email protected]>2017-08-11 01:46:30 +0200
committerAnders Svensson <[email protected]>2017-08-11 01:50:54 +0200
commita73254692913e689aedf1154c0ee378546502501 (patch)
treed4e4bfbb56d8589dda57495e8eec82f97069cd3a /lib/diameter
parentfbc0fe7de4af5d24bd5ccd3eaf2417fbb436da27 (diff)
downloadotp-a73254692913e689aedf1154c0ee378546502501.tar.gz
otp-a73254692913e689aedf1154c0ee378546502501.tar.bz2
otp-a73254692913e689aedf1154c0ee378546502501.zip
Randomly skip groups in traffic suite
To limit the number of testcases being run.
Diffstat (limited to 'lib/diameter')
-rw-r--r--lib/diameter/test/diameter_traffic_SUITE.erl14
1 files changed, 11 insertions, 3 deletions
diff --git a/lib/diameter/test/diameter_traffic_SUITE.erl b/lib/diameter/test/diameter_traffic_SUITE.erl
index 4e70a960c5..fde7e9b8c2 100644
--- a/lib/diameter/test/diameter_traffic_SUITE.erl
+++ b/lib/diameter/test/diameter_traffic_SUITE.erl
@@ -121,6 +121,9 @@
%% ===========================================================================
+%% Fraction of shuffle/parallel groups to randomly skip.
+-define(SKIP, 0.25).
+
%% Positive number of testcases from which to select (randomly) from
%% tc(), the list of testcases to run, or [] to run all. The random
%% selection is to limit the time it takes for the suite to run.
@@ -316,9 +319,14 @@ end_per_suite(_Config) ->
init_per_group(Name, Config)
when Name == shuffle;
Name == parallel ->
- start_services(Config),
- add_transports(Config),
- [{sleep, Name == parallel} | Config];
+ case rand:uniform() < ?SKIP of
+ true ->
+ {skip, random};
+ false ->
+ start_services(Config),
+ add_transports(Config),
+ [{sleep, Name == parallel} | Config]
+ end;
init_per_group(sctp = Name, Config) ->
{_, Sctp} = lists:keyfind(Name, 1, Config),