amqp_client_SUITE: Trim "list_connections" output before parsing it

[Why]
Sometimes, at least in CI, it looks like the output of the CLI is
prepended with a newline, sometimes not. This breaks the check of that
output.

[How]
We just trim the output before parsing it. The parsing already takes
care of trimming internal whitespaces.
This commit is contained in:
Jean-Sébastien Pédron 2025-07-16 13:35:18 +02:00
parent 8307aa6dd2
commit ffaf919846
No known key found for this signature in database
GPG Key ID: 39E99761A5FD94CC
1 changed files with 1 additions and 1 deletions

View File

@ -4087,7 +4087,7 @@ list_connections(Config) ->
%% CLI should list AMQP 1.0 container-id
{ok, StdOut1} = rabbit_ct_broker_helpers:rabbitmqctl(Config, 0, ["list_connections", "--silent", "container_id"]),
ContainerIds0 = re:split(StdOut1, <<"\n">>, [trim]),
ContainerIds0 = re:split(string:trim(StdOut1), <<"\n">>, [trim]),
ContainerIds = lists:sort(ContainerIds0),
?assertEqual([<<>>, ContainerId0, ContainerId2],
ContainerIds),