From c89d08968d9daf2bc5085b7c01c9fa6d73c570b3 Mon Sep 17 00:00:00 2001 From: Aleksey Sabilin Date: Tue, 4 Aug 2026 10:46:32 +0300 Subject: [PATCH] fix(test): drop redundant user.email index setup ensure_tables already adds the email index; a second add_table_index aborted with {already_exists,user,3} and failed the suite setup. --- test/unit/core_user_tests.erl | 6 +----- test/unit/logic_user_tests.erl | 6 +----- 2 files changed, 2 insertions(+), 10 deletions(-) diff --git a/test/unit/core_user_tests.erl b/test/unit/core_user_tests.erl index 53adf07..e377bd5 100644 --- a/test/unit/core_user_tests.erl +++ b/test/unit/core_user_tests.erl @@ -6,12 +6,8 @@ setup() -> eh_test_support:start_mnesia(), + %% email index comes from eh_test_support:ensure_indexes/1 eh_test_support:ensure_tables(?TABLES), - case mnesia:add_table_index(user, email) of - {atomic, ok} -> ok; - {aborted, {already_exists, user, email}} -> ok; - {aborted, Reason} -> error({add_index_failed, Reason}) - end, ok. cleanup(_) -> diff --git a/test/unit/logic_user_tests.erl b/test/unit/logic_user_tests.erl index a401fda..f0b3056 100644 --- a/test/unit/logic_user_tests.erl +++ b/test/unit/logic_user_tests.erl @@ -12,12 +12,8 @@ setup() -> eh_test_support:start_mnesia(), + %% email index comes from eh_test_support:ensure_indexes/1 eh_test_support:ensure_tables(?TABLES), - case mnesia:add_table_index(user, email) of - {atomic, ok} -> ok; - {aborted, {already_exists, user, email}} -> ok; - {aborted, Reason} -> error({add_index_failed, Reason}) - end, ok. cleanup(_) ->