rabbitmq_peer_discovery_{etcd,consul}: Fix error handling if Khepri is unsupported
[How] We must check the return value of `rabbit_ct_broker_helpers:run_steps/2` because it could ask that the testsuite/testgroup/testcase should be skipped.
This commit is contained in:
parent
188241197b
commit
e890b9d37f
|
@ -78,21 +78,27 @@ init_per_testcase(Testcase, Config)
|
|||
Config2,
|
||||
rabbit_ct_broker_helpers:setup_steps() ++
|
||||
rabbit_ct_client_helpers:setup_steps()),
|
||||
try
|
||||
_ = rabbit_ct_broker_helpers:rpc_all(
|
||||
Config3, rabbit_peer_discovery_backend, api_version, []),
|
||||
Config3
|
||||
catch
|
||||
error:{exception, undef,
|
||||
[{rabbit_peer_discovery_backend, api_version, _, _} | _]} ->
|
||||
Config4 = rabbit_ct_helpers:run_steps(
|
||||
Config3,
|
||||
rabbit_ct_client_helpers:teardown_steps() ++
|
||||
rabbit_ct_broker_helpers:teardown_steps()),
|
||||
rabbit_ct_helpers:testcase_finished(Config4, Testcase),
|
||||
{skip,
|
||||
"Some nodes use the old discover->register order; "
|
||||
"the testcase would likely fail"}
|
||||
case Config3 of
|
||||
_ when is_list(Config3) ->
|
||||
try
|
||||
_ = rabbit_ct_broker_helpers:rpc_all(
|
||||
Config3, rabbit_peer_discovery_backend, api_version, []),
|
||||
Config3
|
||||
catch
|
||||
error:{exception, undef,
|
||||
[{rabbit_peer_discovery_backend, api_version, _, _}
|
||||
| _]} ->
|
||||
Config4 = rabbit_ct_helpers:run_steps(
|
||||
Config3,
|
||||
rabbit_ct_client_helpers:teardown_steps() ++
|
||||
rabbit_ct_broker_helpers:teardown_steps()),
|
||||
rabbit_ct_helpers:testcase_finished(Config4, Testcase),
|
||||
{skip,
|
||||
"Some nodes use the old discover->register order; "
|
||||
"the testcase would likely fail"}
|
||||
end;
|
||||
{skip, _} ->
|
||||
Config3
|
||||
end;
|
||||
init_per_testcase(_Testcase, Config) ->
|
||||
Config.
|
||||
|
|
|
@ -89,21 +89,27 @@ init_per_testcase(Testcase, Config)
|
|||
Config2,
|
||||
rabbit_ct_broker_helpers:setup_steps() ++
|
||||
rabbit_ct_client_helpers:setup_steps()),
|
||||
try
|
||||
_ = rabbit_ct_broker_helpers:rpc_all(
|
||||
Config3, rabbit_peer_discovery_backend, api_version, []),
|
||||
Config3
|
||||
catch
|
||||
error:{exception, undef,
|
||||
[{rabbit_peer_discovery_backend, api_version, _, _} | _]} ->
|
||||
Config4 = rabbit_ct_helpers:run_steps(
|
||||
Config3,
|
||||
rabbit_ct_client_helpers:teardown_steps() ++
|
||||
rabbit_ct_broker_helpers:teardown_steps()),
|
||||
rabbit_ct_helpers:testcase_finished(Config4, Testcase),
|
||||
{skip,
|
||||
"Some nodes use the old discover->register order; "
|
||||
"the testcase would likely fail"}
|
||||
case Config3 of
|
||||
_ when is_list(Config3) ->
|
||||
try
|
||||
_ = rabbit_ct_broker_helpers:rpc_all(
|
||||
Config3, rabbit_peer_discovery_backend, api_version, []),
|
||||
Config3
|
||||
catch
|
||||
error:{exception, undef,
|
||||
[{rabbit_peer_discovery_backend, api_version, _, _}
|
||||
| _]} ->
|
||||
Config4 = rabbit_ct_helpers:run_steps(
|
||||
Config3,
|
||||
rabbit_ct_client_helpers:teardown_steps() ++
|
||||
rabbit_ct_broker_helpers:teardown_steps()),
|
||||
rabbit_ct_helpers:testcase_finished(Config4, Testcase),
|
||||
{skip,
|
||||
"Some nodes use the old discover->register order; "
|
||||
"the testcase would likely fail"}
|
||||
end;
|
||||
{skip, _} ->
|
||||
Config3
|
||||
end;
|
||||
init_per_testcase(_Testcase, Config) ->
|
||||
Config.
|
||||
|
|
Loading…
Reference in New Issue