File 0779-Skip-traffic-tests-differently.patch of Package erlang

From e3db347077f99b455ad671a9d768226ef2905ac0 Mon Sep 17 00:00:00 2001
From: Anders Svensson <anders@erlang.org>
Date: Wed, 12 Feb 2020 13:48:11 +0100
Subject: [PATCH 11/11] Skip traffic tests differently

The reduction of the number of traffic cases in the parent commit speeds
up testing, but common_test doesn't seem to do well with the large
number of groups returned from groups/0: one for each of the 1440 config
variants and a few more.

Randomly skip variants when building the groups list instead of when
init_per_group/2 is invoked, to reduce the running time from 12 minutes
mentioned in the parent commit to around 8.
---
 lib/diameter/test/diameter_traffic_SUITE.erl | 14 +++++---------
 1 file changed, 5 insertions(+), 9 deletions(-)

diff --git a/lib/diameter/test/diameter_traffic_SUITE.erl b/lib/diameter/test/diameter_traffic_SUITE.erl
index e5c35be9ca..452bd28333 100644
--- a/lib/diameter/test/diameter_traffic_SUITE.erl
+++ b/lib/diameter/test/diameter_traffic_SUITE.erl
@@ -305,7 +305,8 @@ names() ->
                              S  <- ?STRING_DECODES,
                              ST <- ?CALLBACKS,
                              SS <- ?SENDERS,
-                             CS <- ?SENDERS].
+                             CS <- ?SENDERS,
+                             ?SKIP =< rand:uniform()].
 
 names(Names, []) ->
     [N || N <- Names,
@@ -336,14 +337,9 @@ init_per_group(_) ->
 init_per_group(Name, Config)
   when Name == shuffle;
        Name == parallel ->
-    case rand:uniform() < ?SKIP of
-        true ->
-            {skip, random};
-        false ->
-            start_services(Config),
-            add_transports(Config),
-            replace({sleep, Name == parallel}, Config)
-    end;
+    start_services(Config),
+    add_transports(Config),
+    replace({sleep, Name == parallel}, Config);
 
 init_per_group(sctp = Name, Config) ->
     {_, Sctp} = lists:keyfind(Name, 1, Config),
-- 
2.16.4

openSUSE Build Service is sponsored by