File 0941-ttb-Increase-test-sleeps-for-IP-packets-to-arrive.patch of Package erlang

From c942cc929b4a061bb4b3f2a580bb970a0cf3d899 Mon Sep 17 00:00:00 2001
From: Lukas Larsson <lukas@erlang.org>
Date: Fri, 5 Jun 2020 17:03:07 +0200
Subject: [PATCH 13/18] ttb: Increase test sleeps for IP packets to arrive

On some machines in the tests suites this seems to take a
very long time. This was seen on Windriver Linux running an
old arm-32 processor.
---
 lib/observer/test/ttb_SUITE.erl  | 4 ++--
 lib/observer/test/ttb_helper.erl | 5 ++++-
 2 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/lib/observer/test/ttb_SUITE.erl b/lib/observer/test/ttb_SUITE.erl
index 5d1a5d8dc2..d0b812d0ce 100644
--- a/lib/observer/test/ttb_SUITE.erl
+++ b/lib/observer/test/ttb_SUITE.erl
@@ -738,7 +738,7 @@ diskless(Config) when is_list(Config) ->
     ?line {ok,[{matched,RemoteNode,1}]} = ttb:tp(?MODULE,foo,[]),
 
     ?line rpc:call(RemoteNode,?MODULE,foo,[]),
-    ?line timer:sleep(500), % needed for the IP port to flush
+    ?line timer:sleep(5000), % needed for the IP port to flush
     ?line ttb:stop([nofetch]),
     ?line ok = ttb:format(filename:join(Privdir,
 					atom_to_list(RemoteNode)++"-diskless")),
@@ -767,7 +767,7 @@ diskless_wrap(Config) when is_list(Config) ->
     ?line {ok,[{matched,RemoteNode,1}]} = ttb:tp(?MODULE,foo,[]),
 
     ?line rpc:call(RemoteNode,?MODULE,foo,[]),
-    ?line timer:sleep(500), % needed for the IP port to flush
+    ?line timer:sleep(5000), % needed for the IP port to flush
     ?line ttb:stop([nofetch]),
     ?line ok = ttb:format(filename:join(Privdir,
 					atom_to_list(RemoteNode)++"-diskless.*.wrp")),
diff --git a/lib/observer/test/ttb_helper.erl b/lib/observer/test/ttb_helper.erl
index 05f6d73aef..0f6b8e81b1 100644
--- a/lib/observer/test/ttb_helper.erl
+++ b/lib/observer/test/ttb_helper.erl
@@ -70,7 +70,10 @@ msgs(N) ->
 msgs_ip(N) ->
     [c(client, put, [test_msg]) || _ <- lists:seq(1, N)],
     s(server, received, [a,b]),
-    timer:sleep(500). %% allow trace messages to arrive over tcp/ip
+    %% This is a very high sleep, it is needed for some of the slower
+    %% test machines. Ideally we would want to be able to react to
+    %% when the actual tcp packets arrive, but I'm not sure that is possible..
+    timer:sleep(5000). %% allow trace messages to arrive over tcp/ip
 
 run() ->
     ttb({local, "A"}),
-- 
2.26.2

openSUSE Build Service is sponsored by