definition_import_SUITE: fix a subtle timing issue
In case 16, an await_condition/2 condition was not correctly matching the error. As a result, the function proceeded to the assertion step earlier than it should have, failing with an obscure function_clause. This was because an {error, Context} clause was not correct. In addition to fixing it, this change adds a catch-all clause and verifies the loaded tagged virtual host before running any assertions on it. If the virtual host was not imported, case 16 will now fail with a specific CT log message. References #11457 because the changes there exposed this behavior in CI.
This commit is contained in:
parent
83ab70120c
commit
a656e2e4c6
|
@ -258,15 +258,20 @@ import_case16(Config) ->
|
|||
VHostIsImported =
|
||||
fun () ->
|
||||
case vhost_lookup(Config, VHost) of
|
||||
{error, {no_such_vhosts, _}} -> false;
|
||||
{error, {no_such_vhost, _}} -> false;
|
||||
{error, _} -> false;
|
||||
_ -> true
|
||||
end
|
||||
end,
|
||||
rabbit_ct_helpers:await_condition(VHostIsImported, 20000),
|
||||
VHostRec = vhost_lookup(Config, VHost),
|
||||
case VHostRec of
|
||||
{error, _} -> ct:fail("Failed to import virtual host named 'tagged' in case 16");
|
||||
Val when is_tuple(Val) ->
|
||||
?assertEqual(<<"A case16 description">>, vhost:get_description(VHostRec)),
|
||||
?assertEqual(<<"quorum">>, vhost:get_default_queue_type(VHostRec)),
|
||||
?assertEqual([multi_dc_replication,ab,cde], vhost:get_tags(VHostRec)),
|
||||
?assertEqual([multi_dc_replication,ab,cde], vhost:get_tags(VHostRec))
|
||||
end,
|
||||
|
||||
ok.
|
||||
|
||||
|
|
Loading…
Reference in New Issue