aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorSverker Eriksson <[email protected]>2018-02-12 13:25:02 +0100
committerSverker Eriksson <[email protected]>2018-02-12 13:25:02 +0100
commitecea4b22696dc2aaa57d9f9750fe07efb6b71cde (patch)
treec6b7f5fc93465d5a766c6056deb8aa3633b28b0a /lib
parentd1e89f8df4be7197fdab36a3e1662183a7dfe6ae (diff)
parentd74796ecb17a68d442e846c4032a57cb2c083686 (diff)
downloadotp-ecea4b22696dc2aaa57d9f9750fe07efb6b71cde.tar.gz
otp-ecea4b22696dc2aaa57d9f9750fe07efb6b71cde.tar.bz2
otp-ecea4b22696dc2aaa57d9f9750fe07efb6b71cde.zip
Merge 'sverker/carrier-migration-improvements'
into 'sverker/maint-19/alloc-n-migration/ERIERL-88'
Diffstat (limited to 'lib')
-rw-r--r--lib/stdlib/test/ets_SUITE.erl28
1 files changed, 21 insertions, 7 deletions
diff --git a/lib/stdlib/test/ets_SUITE.erl b/lib/stdlib/test/ets_SUITE.erl
index 00e02a06cc..a58497523a 100644
--- a/lib/stdlib/test/ets_SUITE.erl
+++ b/lib/stdlib/test/ets_SUITE.erl
@@ -5716,25 +5716,39 @@ etsmem() ->
end},
{Mem,AllTabs}.
-verify_etsmem({MemInfo,AllTabs}) ->
+
+verify_etsmem(MI) ->
wait_for_test_procs(),
+ verify_etsmem(MI, 1).
+
+verify_etsmem({MemInfo,AllTabs}, Try) ->
case etsmem() of
{MemInfo,_} ->
io:format("Ets mem info: ~p", [MemInfo]),
- case MemInfo of
- {ErlMem,EtsAlloc} when ErlMem == notsup; EtsAlloc == undefined ->
+ case {MemInfo, Try} of
+ {{ErlMem,EtsAlloc},_} when ErlMem == notsup; EtsAlloc == undefined ->
%% Use 'erl +Mea max' to do more complete memory leak testing.
{comment,"Incomplete or no mem leak testing"};
- _ ->
- ok
+ {_, 1} ->
+ ok;
+ _ ->
+ {comment, "Transient memory discrepancy"}
end;
{MemInfo2, AllTabs2} ->
io:format("Expected: ~p", [MemInfo]),
io:format("Actual: ~p", [MemInfo2]),
io:format("Changed tables before: ~p\n",[AllTabs -- AllTabs2]),
io:format("Changed tables after: ~p\n", [AllTabs2 -- AllTabs]),
- ets_test_spawn_logger ! {failed_memcheck, get('__ETS_TEST_CASE__')},
- {comment, "Failed memory check"}
+ case Try < 2 of
+ true ->
+ io:format("\nThis discrepancy could be caused by an "
+ "inconsistent memory \"snapshot\""
+ "\nTry again...\n", []),
+ verify_etsmem({MemInfo, AllTabs}, Try+1);
+ false ->
+ ets_test_spawn_logger ! {failed_memcheck, get('__ETS_TEST_CASE__')},
+ {comment, "Failed memory check"}
+ end
end.