Skip to content

Commit

Permalink
Use unique names for fresh story users
Browse files Browse the repository at this point in the history
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)
  • Loading branch information
arcusfelis committed Dec 2, 2021
1 parent 41924b7 commit c562491
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/escalus_fresh.erl
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down

0 comments on commit c562491

Please sign in to comment.