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,13 +78,16 @@ init_per_testcase(Testcase, Config)
|
||||||
Config2,
|
Config2,
|
||||||
rabbit_ct_broker_helpers:setup_steps() ++
|
rabbit_ct_broker_helpers:setup_steps() ++
|
||||||
rabbit_ct_client_helpers:setup_steps()),
|
rabbit_ct_client_helpers:setup_steps()),
|
||||||
|
case Config3 of
|
||||||
|
_ when is_list(Config3) ->
|
||||||
try
|
try
|
||||||
_ = rabbit_ct_broker_helpers:rpc_all(
|
_ = rabbit_ct_broker_helpers:rpc_all(
|
||||||
Config3, rabbit_peer_discovery_backend, api_version, []),
|
Config3, rabbit_peer_discovery_backend, api_version, []),
|
||||||
Config3
|
Config3
|
||||||
catch
|
catch
|
||||||
error:{exception, undef,
|
error:{exception, undef,
|
||||||
[{rabbit_peer_discovery_backend, api_version, _, _} | _]} ->
|
[{rabbit_peer_discovery_backend, api_version, _, _}
|
||||||
|
| _]} ->
|
||||||
Config4 = rabbit_ct_helpers:run_steps(
|
Config4 = rabbit_ct_helpers:run_steps(
|
||||||
Config3,
|
Config3,
|
||||||
rabbit_ct_client_helpers:teardown_steps() ++
|
rabbit_ct_client_helpers:teardown_steps() ++
|
||||||
|
@ -94,6 +97,9 @@ init_per_testcase(Testcase, Config)
|
||||||
"Some nodes use the old discover->register order; "
|
"Some nodes use the old discover->register order; "
|
||||||
"the testcase would likely fail"}
|
"the testcase would likely fail"}
|
||||||
end;
|
end;
|
||||||
|
{skip, _} ->
|
||||||
|
Config3
|
||||||
|
end;
|
||||||
init_per_testcase(_Testcase, Config) ->
|
init_per_testcase(_Testcase, Config) ->
|
||||||
Config.
|
Config.
|
||||||
|
|
||||||
|
|
|
@ -89,13 +89,16 @@ init_per_testcase(Testcase, Config)
|
||||||
Config2,
|
Config2,
|
||||||
rabbit_ct_broker_helpers:setup_steps() ++
|
rabbit_ct_broker_helpers:setup_steps() ++
|
||||||
rabbit_ct_client_helpers:setup_steps()),
|
rabbit_ct_client_helpers:setup_steps()),
|
||||||
|
case Config3 of
|
||||||
|
_ when is_list(Config3) ->
|
||||||
try
|
try
|
||||||
_ = rabbit_ct_broker_helpers:rpc_all(
|
_ = rabbit_ct_broker_helpers:rpc_all(
|
||||||
Config3, rabbit_peer_discovery_backend, api_version, []),
|
Config3, rabbit_peer_discovery_backend, api_version, []),
|
||||||
Config3
|
Config3
|
||||||
catch
|
catch
|
||||||
error:{exception, undef,
|
error:{exception, undef,
|
||||||
[{rabbit_peer_discovery_backend, api_version, _, _} | _]} ->
|
[{rabbit_peer_discovery_backend, api_version, _, _}
|
||||||
|
| _]} ->
|
||||||
Config4 = rabbit_ct_helpers:run_steps(
|
Config4 = rabbit_ct_helpers:run_steps(
|
||||||
Config3,
|
Config3,
|
||||||
rabbit_ct_client_helpers:teardown_steps() ++
|
rabbit_ct_client_helpers:teardown_steps() ++
|
||||||
|
@ -105,6 +108,9 @@ init_per_testcase(Testcase, Config)
|
||||||
"Some nodes use the old discover->register order; "
|
"Some nodes use the old discover->register order; "
|
||||||
"the testcase would likely fail"}
|
"the testcase would likely fail"}
|
||||||
end;
|
end;
|
||||||
|
{skip, _} ->
|
||||||
|
Config3
|
||||||
|
end;
|
||||||
init_per_testcase(_Testcase, Config) ->
|
init_per_testcase(_Testcase, Config) ->
|
||||||
Config.
|
Config.
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue