-
Notifications
You must be signed in to change notification settings - Fork 428
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Initialise domain workers in the supervision tree instead of manually #4069
Conversation
3b5ca2f
to
fd48ea6
Compare
This comment was marked as outdated.
This comment was marked as outdated.
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## master #4069 +/- ##
==========================================
+ Coverage 83.88% 83.90% +0.01%
==========================================
Files 526 527 +1
Lines 33181 33158 -23
==========================================
- Hits 27834 27820 -14
+ Misses 5347 5338 -9
☔ View full report in Codecov by Sentry. |
fd48ea6
to
f032d51
Compare
This comment was marked as outdated.
This comment was marked as outdated.
f032d51
to
89a76b6
Compare
This comment was marked as outdated.
This comment was marked as outdated.
89a76b6
to
342e9b9
Compare
This comment was marked as outdated.
This comment was marked as outdated.
342e9b9
to
f4055ee
Compare
This comment was marked as outdated.
This comment was marked as outdated.
f4055ee
to
fc963c3
Compare
This comment was marked as outdated.
This comment was marked as outdated.
fc963c3
to
a2f641a
Compare
small_tests_24 / small_tests / a2f641a elasticsearch_and_cassandra_25 / elasticsearch_and_cassandra_mnesia / a2f641a small_tests_25 / small_tests / a2f641a small_tests_25_arm64 / small_tests / a2f641a ldap_mnesia_24 / ldap_mnesia / a2f641a dynamic_domains_pgsql_mnesia_24 / pgsql_mnesia / a2f641a dynamic_domains_pgsql_mnesia_25 / pgsql_mnesia / a2f641a ldap_mnesia_25 / ldap_mnesia / a2f641a dynamic_domains_mysql_redis_25 / mysql_redis / a2f641a dynamic_domains_mssql_mnesia_25 / odbc_mssql_mnesia / a2f641a pgsql_mnesia_24 / pgsql_mnesia / a2f641a mod_global_distrib_SUITE:hosts_refresher:test_host_refreshing{error,
{{trees_for_connections_present,true,[{times,100,false}],ok},
[{mongoose_helper,do_wait_until,2,
[{file,"/home/circleci/project/big_tests/tests/mongoose_helper.erl"},
{line,357}]},
{mod_global_distrib_SUITE,test_host_refreshing,1,
[{file,
"/home/circleci/project/big_tests/tests/mod_global_distrib_SUITE.erl"},
{line,384}]},
{test_server,ts_tc,3,[{file,"test_server.erl"},{line,1783}]},
{test_server,run_test_case_eval1,6,
[{file,"test_server.erl"},{line,1292}]},
{test_server,run_test_case_eval,9,
[{file,"test_server.erl"},{line,1224}]}]}} internal_mnesia_25 / internal_mnesia / a2f641a pgsql_mnesia_25 / pgsql_mnesia / a2f641a mysql_redis_25 / mysql_redis / a2f641a metrics_c2s_SUITE:single:presence_direct_one{error,
{{xmppPresenceReceived,
{value,2842},
[{times,25,
{error,
{badmatch,{value,2843}},
[{metrics_helper,assert_counter,3,
[{file,
"/home/circleci/project/big_tests/tests/metrics_helper.erl"},
{line,36}]},
{mongoose_helper,do_wait_until,2,
[{file,
"/home/circleci/project/big_tests/tests/mongoose_helper.erl"},
{line,360}]},
{metrics_c2s_SUITE,'-presence_direct_one/1-fun-0-',2,
[{file,
"/home/circleci/project/big_tests/tests/metrics_c2s_SUITE.erl"},
{line,143}]},
{escalus_story,story,4,
[{file,
"/home/circleci/project/big_tests/_build/default/lib/escalus/src/escalus_story.erl"},
{line,72}]},
{test_server,ts_tc,3,
[{file,"test_server.erl"},{line,1782}]},
{test_server,run_test_case_eval1,6,
[{file,"test_server.erl"},{line,1291}]},
{test_server,run_test_case_eval,9,
[{file,"test_server.erl"},{line,1223}]}]}}],
ok},
[{mongoose_helper,do_wait_until,2,
[{file,"/home/circleci/project/big_tests/tests/mongoose_helper.erl"},
{line,357}]},
{metrics_c2s_SUITE,'-presence_direct_one/1-fun-0-',2,
[{file,
"/home/circleci/project/big_tests/tests/metrics_c2s_SUITE.erl"},
{line,143}]},
{escalus_story,story,4,
[{file,
"/home/circleci/... mssql_mnesia_25 / odbc_mssql_mnesia / a2f641a mysql_redis_25 / mysql_redis / a2f641a pgsql_mnesia_24 / pgsql_mnesia / a2f641a |
src/domain/mongoose_domain_api.erl
Outdated
mongoose_domain_core:start(), | ||
mongoose_subdomain_core:start(), | ||
mongoose_lazy_routing:start(). | ||
mongoose_domain_core:start_link(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Linking is something we normally want to avoid for the testing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please revert this change
src/domain/mongoose_domain_core.erl
Outdated
@@ -46,7 +46,11 @@ | |||
start() -> | |||
Pairs = get_static_pairs(), | |||
AllowedHostTypes = mongoose_config:get_opt(host_types), | |||
start(Pairs, AllowedHostTypes). | |||
ChildSpec = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is testing version of start/2 used anywhere?
Please do not duplicate ChildSpec definition, start/0 should call start/2 with default parameters.
src/domain/mongoose_lazy_routing.erl
Outdated
@@ -43,7 +43,7 @@ | |||
terminate/2, | |||
code_change/3]). | |||
|
|||
-ignore_xref([start_link/0, stop/0, sync/0]). | |||
-ignore_xref([start_link/0, start/0, stop/0, sync/0]). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why do we need to add start/0 now? What has changed?
test/mongoose_cleanup_SUITE.erl
Outdated
@@ -36,7 +36,13 @@ init_per_suite(Config) -> | |||
ok = mnesia:create_schema([node()]), | |||
ok = mnesia:start(), | |||
[mongoose_config:set_opt(Key, Value) || {Key, Value} <- opts()], | |||
mongoose_domain_api:init(), | |||
Self = self(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just eliminate linking for unit testing.
Follow cleaner OTP supervision conventions, we want these workers supervised.
a2f641a
to
73ef2c5
Compare
small_tests_24 / small_tests / 73ef2c5 elasticsearch_and_cassandra_25 / elasticsearch_and_cassandra_mnesia / 73ef2c5 small_tests_25 / small_tests / 73ef2c5 small_tests_25_arm64 / small_tests / 73ef2c5 ldap_mnesia_24 / ldap_mnesia / 73ef2c5 dynamic_domains_pgsql_mnesia_24 / pgsql_mnesia / 73ef2c5 ldap_mnesia_25 / ldap_mnesia / 73ef2c5 dynamic_domains_pgsql_mnesia_25 / pgsql_mnesia / 73ef2c5 dynamic_domains_mysql_redis_25 / mysql_redis / 73ef2c5 internal_mnesia_25 / internal_mnesia / 73ef2c5 pubsub_SUITE:tree+basic:publish_only_retract_items_scope_test{error,{{badmatch,false},
[{pubsub_tools,check_response,2,
[{file,"/home/circleci/project/big_tests/tests/pubsub_tools.erl"},
{line,444}]},
{pubsub_tools,receive_response,3,
[{file,"/home/circleci/project/big_tests/tests/pubsub_tools.erl"},
{line,434}]},
{pubsub_tools,receive_and_check_response,4,
[{file,"/home/circleci/project/big_tests/tests/pubsub_tools.erl"},
{line,424}]},
{pubsub_SUITE,'-publish_only_retract_items_scope_test/1-fun-0-',2,
[{file,"/home/circleci/project/big_tests/tests/pubsub_SUITE.erl"},
{line,645}]},
{escalus_story,story,4,
[{file,"/home/circleci/project/big_tests/_build/default/lib/escalus/src/escalus_story.erl"},
{line,72}]},
{test_server,ts_tc,3,[{file,"test_server.erl"},{line,1782}]},
{test_server,run_test_case_eval1,6,
[{file,"test_server.erl"},{line,1291}]},
{test_server,run_test_case_eval,9,
[{file,"test_server.erl"},{line,1223}]}]}} pgsql_mnesia_24 / pgsql_mnesia / 73ef2c5 dynamic_domains_mssql_mnesia_25 / odbc_mssql_mnesia / 73ef2c5 pgsql_mnesia_25 / pgsql_mnesia / 73ef2c5 mysql_redis_25 / mysql_redis / 73ef2c5 mssql_mnesia_25 / odbc_mssql_mnesia / 73ef2c5 internal_mnesia_25 / internal_mnesia / 73ef2c5 |
mongoose_config:unset_opt({auth, host_type()}), | ||
mnesia:stop(), | ||
mnesia:delete_schema([node()]). | ||
|
||
init_per_testcase(_TC, Config) -> | ||
mongoose_domain_core:start_link([{domain(), host_type()}], []), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add a comment that mongoose_domain_core
"stops" because every TC runs in a separate process and linking ensure termination of mongoose_domain_core
, and parallel execution of TCs is not possible.
[mongoose_config:unset_opt(Key) || {Key, _Value} <- opts()], | ||
mnesia:stop(), | ||
mnesia:delete_schema([node()]), | ||
Config. | ||
|
||
init_per_testcase(TestCase, Config) -> | ||
{ok, _HooksServer} = gen_hook:start_link(), | ||
{ok, _DomainSup} = mongoose_domain_sup:start_link(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the same comment as for test/auth_internal_SUITE.erl
Follow cleaner OTP supervision conventions, we want these workers supervised by their common supervisor, started cleanly within the supervision tree.