From c562491bf0cfa0cff876ff3c601665e9b959b633 Mon Sep 17 00:00:00 2001 From: Mikhail Uvarov Date: Thu, 2 Dec 2021 17:58:15 +0100 Subject: [PATCH] Use unique names for fresh story users Some suites run the same testcase several times This means a duplicate key error could occure when registering a new user This also means some random stanzas would come from another cases It is especially visible when two cases run in parallel (but it is not a requirement) --- src/escalus_fresh.erl | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/escalus_fresh.erl b/src/escalus_fresh.erl index f20fc6d..a933725 100644 --- a/src/escalus_fresh.erl +++ b/src/escalus_fresh.erl @@ -205,9 +205,7 @@ select(UserResources, FullSpecs) -> FullSpecs). fresh_int_suffix() -> - {_, S, US} = erlang:timestamp(), - L = lists:flatten([integer_to_list(S rem 100), ".", integer_to_list(US)]), - list_to_binary(L). + integer_to_binary(erlang:unique_integer([monotonic, positive])). case_name_suffix(Config) -> CaseName = proplists:get_value(tc_name, Config, unnamed),