aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorSverker Eriksson <[email protected]>2016-08-30 11:49:20 +0200
committerSverker Eriksson <[email protected]>2016-09-19 15:50:14 +0200
commit25eb3fe353cb0f5c381107e43a865d3a312c8c25 (patch)
tree3cb4f77871c759f2353e47f9d2cfe83ee9ed7c12 /lib
parent92c98a138638541a710f17f21073b568362502f8 (diff)
downloadotp-25eb3fe353cb0f5c381107e43a865d3a312c8c25.tar.gz
otp-25eb3fe353cb0f5c381107e43a865d3a312c8c25.tar.bz2
otp-25eb3fe353cb0f5c381107e43a865d3a312c8c25.zip
erts: Suppress failed ETS memory checks
due to the grow/shrink hysteresis of the meta tables
Diffstat (limited to 'lib')
-rw-r--r--lib/stdlib/test/ets_SUITE.erl34
1 files changed, 26 insertions, 8 deletions
diff --git a/lib/stdlib/test/ets_SUITE.erl b/lib/stdlib/test/ets_SUITE.erl
index 6835e745bc..ea555f9c39 100644
--- a/lib/stdlib/test/ets_SUITE.erl
+++ b/lib/stdlib/test/ets_SUITE.erl
@@ -218,7 +218,7 @@ memory_check_summary(_Config) ->
receive {get_failed_memchecks, FailedMemchecks} -> ok end,
io:format("Failed memchecks: ~p\n",[FailedMemchecks]),
NoFailedMemchecks = length(FailedMemchecks),
- if NoFailedMemchecks > 3 ->
+ if NoFailedMemchecks > 1 ->
ct:fail("Too many failed (~p) memchecks", [NoFailedMemchecks]);
true ->
ok
@@ -5728,27 +5728,45 @@ etsmem() ->
{Bl0+Bl,BlSz0+BlSz}
end, {0,0}, CS)
end},
- {Mem,AllTabs}.
+ {Mem,AllTabs, erts_debug:get_internal_state('DbTable_meta')}.
-verify_etsmem({MemInfo,AllTabs}) ->
+verify_etsmem(EtsMem) ->
wait_for_test_procs(),
+ verify_etsmem(EtsMem, false).
+
+verify_etsmem({MemInfo,AllTabs,MetaState}=EtsMem, Adjusted) ->
case etsmem() of
- {MemInfo,_} ->
+ {MemInfo,_,_} ->
io:format("Ets mem info: ~p", [MemInfo]),
case MemInfo 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
+ case Adjusted of
+ true ->
+ {comment, "Meta state adjusted"};
+ false ->
+ ok
+ end
end;
- {MemInfo2, AllTabs2} ->
+
+ {MemInfo2, AllTabs2, MetaState2} ->
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"}
+ io:format("Meta state before: ~p\n", [MetaState]),
+ io:format("Meta state after: ~p\n", [MetaState2]),
+ case {MetaState =:= MetaState2, Adjusted} of
+ {false, false} ->
+ io:format("Adjust meta state and retry...\n\n",[]),
+ {ok,ok} = erts_debug:set_internal_state('DbTable_meta', MetaState),
+ verify_etsmem(EtsMem, true);
+ _ ->
+ ets_test_spawn_logger ! {failed_memcheck, get('__ETS_TEST_CASE__')},
+ {comment, "Failed memory check"}
+ end
end.