test(fix): fix flaky prop

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',''}]}]}.
```
This commit is contained in:
Thales Macedo Garitezi 2022-02-22 17:57:00 -03:00
parent f173a2f61f
commit 8141c38ce1
No known key found for this signature in database
GPG Key ID: DD279F8152A9B6DD
1 changed files with 2 additions and 1 deletions

View File

@ -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),