From 8141c38ce19a3c85cdb99091392c85226133da10 Mon Sep 17 00:00:00 2001 From: Thales Macedo Garitezi Date: Tue, 22 Feb 2022 17:57:00 -0300 Subject: [PATCH] test(fix): fix flaky prop MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Failing when duplicate elements were being generated. ``` An exception was raised: error:{assertEqual, [{module,emqx_hooks_SUITE}, {line,65}, {expression,"Order"}, {expected, [{5,'',''}, {5,'',''}, {4,'\223',''}, {2,'}Ijrµ\036',''}]}, {value, [{5,'',''}, {4,'\223',''}, {2,'}Ijrµ\036',''}]}]}. ``` --- apps/emqx/test/emqx_hooks_SUITE.erl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/apps/emqx/test/emqx_hooks_SUITE.erl b/apps/emqx/test/emqx_hooks_SUITE.erl index eb0189b42..4c3414a71 100644 --- a/apps/emqx/test/emqx_hooks_SUITE.erl +++ b/apps/emqx/test/emqx_hooks_SUITE.erl @@ -55,8 +55,9 @@ add_hook_order_prop() -> (Prio1 =:= Prio2 andalso {M1, F1} =< {M2, F2}) end, ?FORALL( - Hooks, list({range(-1, 5), atom(), atom()}), + Hooks0, list({range(-1, 5), atom(), atom()}), try + Hooks = sets:to_list(sets:from_list(Hooks0)), {ok, _} = emqx_hooks:start_link(), [emqx:hook(prop_hook, {M, F, []}, Prio) || {Prio, M, F} <- Hooks], Callbacks = emqx_hooks:lookup(prop_hook),