test: fix downstream_migration metric labels (add dc_id)

Metric was emitted with 3 labels [listener, dc_id, result] since
3c29fa3 (Include dc_id to migration metric) but tests were still
matching only [listener, result], causing wait_for_value to time out.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
Sergey Prokhorov 2026-04-11 18:30:23 +02:00
parent 3c29fa31e5
commit 8ce8f2196d
No known key found for this signature in database
GPG key ID: 1C570244E4EF3337

View file

@ -807,7 +807,7 @@ downstream_migration_case(Cfg) when is_list(Cfg) ->
%% Wait until handler has successfully migrated to the surviving downstream.
ok = mtp_test_metric:wait_for_value(
count, [?APP, downstream_migration, total],
[?FUNCTION_NAME, ok], 1, 5000),
[?FUNCTION_NAME, DcId, ok], 1, 5000),
%% Client must still work after migration.
Cli2 = ping(Cli1),
%% Pool tracking must be clean: exactly 1 upstream registered.
@ -848,7 +848,7 @@ downstream_migration_multi_case(Cfg) when is_list(Cfg) ->
%% Wait until exactly NOnServer clients have successfully migrated.
ok = mtp_test_metric:wait_for_value(
count, [?APP, downstream_migration, total],
[?FUNCTION_NAME, ok], NOnServer, 5000),
[?FUNCTION_NAME, DcId, ok], NOnServer, 5000),
Clients2 = [ping(C) || C <- Clients1],
?assertMatch(#{n_upstreams := N}, mtp_dc_pool:status(Pool)),
[ok = mtp_test_client:close(C) || C <- Clients2]