test(emqx_machine): ensure node is down before testing open ports

This commit is contained in:
Ivan Dyachkov 2024-04-11 15:24:41 +02:00
parent 3b7cade671
commit b27fc0da26
1 changed files with 6 additions and 0 deletions

View File

@ -144,7 +144,13 @@ t_open_ports_check(Config) ->
?assertEqual(ok, erpc:call(Core2, emqx_machine, open_ports_check, [])),
?assertEqual(ok, erpc:call(Replicant, emqx_machine, open_ports_check, [])),
true = erlang:monitor_node(Core2, true),
ok = emqx_cth_cluster:stop_node(Core2),
receive
{nodedown, Core2} -> ok
after 10000 ->
ct:fail("nodedown message not received after 10 seconds.")
end,
?assertEqual(ok, erpc:call(Replicant, emqx_machine, open_ports_check, [])),
Results = erpc:call(Core1, emqx_machine, open_ports_check, []),