test: make ticket messages unique across IFT runs via system_time
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -338,10 +338,13 @@ unique_email(Prefix) ->
|
|||||||
|
|
||||||
%% Уникальное сообщение тикета на прогон (IFT: иначе дедуп по error_hash
|
%% Уникальное сообщение тикета на прогон (IFT: иначе дедуп по error_hash
|
||||||
%% возвращает чужой reporter_id и list/get своих тикетов падает).
|
%% возвращает чужой reporter_id и list/get своих тикетов падает).
|
||||||
|
%% system_time — стабильно уникален между контейнерами; unique_integer —
|
||||||
|
%% различает вызовы внутри одного прогона (monotonic сбрасывается при старте BEAM).
|
||||||
-spec unique_ticket_message(binary()) -> binary().
|
-spec unique_ticket_message(binary()) -> binary().
|
||||||
unique_ticket_message(Prefix) ->
|
unique_ticket_message(Prefix) ->
|
||||||
Unique = integer_to_binary(erlang:unique_integer([positive, monotonic])),
|
Time = integer_to_binary(erlang:system_time()),
|
||||||
<<Prefix/binary, " ", Unique/binary>>.
|
Seq = integer_to_binary(erlang:unique_integer([positive, monotonic])),
|
||||||
|
<<Prefix/binary, " ", Time/binary, "-", Seq/binary>>.
|
||||||
|
|
||||||
-spec future_date() -> calendar:datetime().
|
-spec future_date() -> calendar:datetime().
|
||||||
future_date() ->
|
future_date() ->
|
||||||
|
|||||||
Reference in New Issue
Block a user