File 2577-mnesia-Decrease-test-loop-on-slow-machines.patch of Package erlang

From ce0b5869f3ed5ee63e104c1e15387b71818746af Mon Sep 17 00:00:00 2001
From: Dan Gudmundsson <dgud@erlang.org>
Date: Mon, 8 Jun 2020 15:42:14 +0200
Subject: [PATCH 3/5] mnesia: Decrease test loop on slow machines

Some are really slow.
---
 lib/mnesia/test/mnesia_isolation_test.erl | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/lib/mnesia/test/mnesia_isolation_test.erl b/lib/mnesia/test/mnesia_isolation_test.erl
index 76b0d07b17..a65bfd31e1 100644
--- a/lib/mnesia/test/mnesia_isolation_test.erl
+++ b/lib/mnesia/test/mnesia_isolation_test.erl
@@ -629,7 +629,12 @@ sticky_sync(Config) when is_list(Config) ->
         end,
 
     %% Fill 1000 dc records. At the end all dc records should have value 1.
-    lists:foreach(TestFun, lists:seq(1,1000)),
+    {Time, ok} = timer:tc(fun() -> lists:foreach(TestFun, lists:seq(1,200)) end),
+    io:format("200 trans done in ~p ~n",[Time div (1000000)]),
+    case (Time div (1000000)) < 20 of
+        false -> lists:foreach(TestFun, lists:seq(201,1000));
+        true -> ignore  %% Some virtual test machines are really slow..
+    end,
     io:format("Written, check content~n",[]),
     All = fun() -> mnesia:select(dc, [ {{dc, '_', 0}, [] ,['$_']} ]) end,
     ?match({atomic, []}, rpc:call(N1, mnesia, sync_transaction, [All])),
-- 
2.26.2

openSUSE Build Service is sponsored by