Skip to content

Commit

Permalink
Instead of clearing tables when starting a group, clear them when end…
Browse files Browse the repository at this point in the history
…ing a group

Because a group may be started but the tables are not yet created,
as they are created automatically when update_sql_schema is enabled.

This modifies commit e2b79ea
  • Loading branch information
badlop committed Apr 15, 2024
1 parent 0d37e65 commit 297f743
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions test/ejabberd_SUITE.erl
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,6 @@ do_init_per_group(mysql, Config) ->
case catch ejabberd_sql:sql_query(?MYSQL_VHOST, [<<"select 1;">>]) of
{selected, _, _} ->
mod_muc:shutdown_rooms(?MYSQL_VHOST),
clear_sql_tables(mysql, Config),
update_sql(?MYSQL_VHOST, Config),
set_opt(server, ?MYSQL_VHOST, Config);
Err ->
Expand All @@ -109,7 +108,6 @@ do_init_per_group(mssql, Config) ->
case catch ejabberd_sql:sql_query(?MSSQL_VHOST, [<<"select 1;">>]) of
{selected, _, _} ->
mod_muc:shutdown_rooms(?MSSQL_VHOST),
clear_sql_tables(mssql, Config),
update_sql(?MSSQL_VHOST, Config),
set_opt(server, ?MSSQL_VHOST, Config);
Err ->
Expand All @@ -119,7 +117,6 @@ do_init_per_group(pgsql, Config) ->
case catch ejabberd_sql:sql_query(?PGSQL_VHOST, [<<"select 1;">>]) of
{selected, _, _} ->
mod_muc:shutdown_rooms(?PGSQL_VHOST),
clear_sql_tables(pgsql, Config),
update_sql(?PGSQL_VHOST, Config),
set_opt(server, ?PGSQL_VHOST, Config);
Err ->
Expand Down Expand Up @@ -168,11 +165,14 @@ end_per_group(mnesia, _Config) ->
ok;
end_per_group(redis, _Config) ->
ok;
end_per_group(mysql, _Config) ->
end_per_group(mysql, Config) ->
clear_sql_tables(mysql, Config),
ok;
end_per_group(mssql, _Config) ->
end_per_group(mssql, Config) ->
clear_sql_tables(mssql, Config),
ok;
end_per_group(pgsql, _Config) ->
end_per_group(pgsql, Config) ->
clear_sql_tables(pgsql, Config),
ok;
end_per_group(sqlite, _Config) ->
ok;
Expand Down

0 comments on commit 297f743

Please sign in to comment.