-
Notifications
You must be signed in to change notification settings - Fork 426
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
C2S/Enable pep_SUITE #3931
C2S/Enable pep_SUITE #3931
Conversation
This comment was marked as outdated.
This comment was marked as outdated.
Codecov ReportBase: 82.11% // Head: 82.67% // Increases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## feature/mongoose_c2s #3931 +/- ##
========================================================
+ Coverage 82.11% 82.67% +0.56%
========================================================
Files 540 540
Lines 34198 34228 +30
========================================================
+ Hits 28082 28299 +217
+ Misses 6116 5929 -187
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
99b84d6
to
d9ca903
Compare
This comment was marked as outdated.
This comment was marked as outdated.
d9ca903
to
311d94f
Compare
This comment was marked as outdated.
This comment was marked as outdated.
311d94f
to
6f1cc15
Compare
This comment was marked as outdated.
This comment was marked as outdated.
6f1cc15
to
9635733
Compare
This comment was marked as outdated.
This comment was marked as outdated.
9635733
to
571431a
Compare
This comment was marked as outdated.
This comment was marked as outdated.
d014a04
to
77a33a9
Compare
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
77a33a9
to
309f43a
Compare
This comment was marked as outdated.
This comment was marked as outdated.
309f43a
to
5a8f89a
Compare
This comment was marked as outdated.
This comment was marked as outdated.
5a8f89a
to
699ec5f
Compare
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
7d4884d
to
c4e006f
Compare
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
1ff3886
to
3e298d3
Compare
This comment was marked as outdated.
This comment was marked as outdated.
mongoose_c2s was missing the logic for handling PEP messages, because now the logic does not belong in the c2s module anymore Main changes: - During send_last_pep_items, filtering by features is made on the spot - Functionality is not delegated to the c2s process anymore. - foreign_event is used to call the PEP-related hooks - dispatch_items no longer delegates the sending to the c2s process. Now the process is only called to get/filter recipients by caps. - unsubscribe_user is not spawning new processes anymore, because this behaviour was causing race conditions. The operation does not seem to be heavy.
3e298d3
to
81641db
Compare
This comment was marked as outdated.
This comment was marked as outdated.
One hook needed updating, another one was missing entirely.
Also: handle the case of IQ request timeout. It was crashing.
Also: add gen_statem call timeouts to prevent infinite deadlocks.
- Enable cache_tests, which were somehow disabled - Handle the new stanza order, where the presence comes before the iq request. - Remove arbitrary sleep's that were not fixing the race conditions anyway. Some race conditions still apply - and they are handled explicitly now. - Test the newly discovered issue of missing notifications in case of one-way presence subscriptions.
81641db
to
bca08ff
Compare
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
d8c3cdd
to
bca08ff
Compare
bca08ff
to
5c5f06e
Compare
This comment was marked as outdated.
This comment was marked as outdated.
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 a first first comment for now, more review in progress.
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.
A couple more comments. I still need to read in depth the changes in the test suites, will do later today, but for now a few more notes :)
small_tests_24 / small_tests / 05322df small_tests_25 / small_tests / 05322df ldap_mnesia_24 / ldap_mnesia / 05322df dynamic_domains_pgsql_mnesia_24 / pgsql_mnesia / 05322df ldap_mnesia_25 / ldap_mnesia / 05322df dynamic_domains_mysql_redis_25 / mysql_redis / 05322df muc_SUITE:hibernation:hibernated_room_can_be_queried_for_archive{error,{{assertion_failed,assert,is_groupchat_message,
[<<"Restorable message">>],
undefined,"undefined"},
[{escalus_new_assert,assert_true,2,
[{file,"/home/circleci/project/big_tests/_build/default/lib/escalus/src/escalus_new_assert.erl"},
{line,84}]},
{muc_SUITE,wait_for_mam_result,3,
[{file,"/home/circleci/project/big_tests/tests/muc_SUITE.erl"},
{line,4394}]},
{muc_SUITE,'-hibernated_room_can_be_queried_for_archive/1-fun-0-',3,
[{file,"/home/circleci/project/big_tests/tests/muc_SUITE.erl"},
{line,4130}]},
{escalus_story,story,4,
[{file,"/home/circleci/project/big_tests/_build/default/lib/escalus/src/escalus_story.erl"},
{line,72}]},
{muc_SUITE,hibernated_room_can_be_queried_for_archive,1,
[{file,"/home/circleci/project/big_tests/tests/muc_SUITE.erl"},
{line,4126}]},
{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}]}]}} dynamic_domains_pgsql_mnesia_25 / pgsql_mnesia / 05322df pgsql_mnesia_24 / pgsql_mnesia / 05322df dynamic_domains_mssql_mnesia_25 / odbc_mssql_mnesia / 05322df inbox_extensions_SUITE:regular:one_to_one:pagination:can_paginate_backwards{error,
{timeout_when_waiting_for_stanza,
[{escalus_client,wait_for_stanza,
[{client,
<<"[email protected]/res1">>,
escalus_tcp,<0.12982.1>,
[{event_manager,<0.12966.1>},
{server,<<"domain.example.com">>},
{username,<<"bOb_can_paginate_backwards_1503">>},
{resource,<<"res1">>}],
[{event_client,
[{event_manager,<0.12966.1>},
{server,<<"domain.example.com">>},
{username,<<"bOb_can_paginate_backwards_1503">>},
{resource,<<"res1">>}]},
{resource,<<"res1">>},
{username,<<"bob_can_paginate_backwards_1503">>},
{server,<<"domain.example.com">>},
{host,<<"localhost">>},
{port,5222},
{auth,{escalus_auth,auth_plain}},
{wspath,undefined},
{username,<<"bOb_can_paginate_backwards_1503">>},
{server,<<"domain.example.com">>},
{host,<<"localhost">>},
{password,<<"makrolika">>},
{stream_id,<<"af92a003a053c140">>}]},
5000],
[{file,
"/home/circleci/project/big_tests/_build/default/lib/escalus/src/escalus_client.erl"},
{line,136}]},
{inbox_helper,'-given_conversations_between/2-fun-1-',4,
[{file,"/home/circleci/project/big_tests/tests/inbox_helper.erl"},
{line,543}]},
{lists,foldl,3,[{file,"lists.erl"},{line,1350}]},
{inbox_extensions_SUITE... inbox_extensions_SUITE:regular:one_to_one:pagination:can_paginate_forwards{error,
{timeout_when_waiting_for_stanza,
[{escalus_client,wait_for_stanza,
[{client,
<<"[email protected]/res1">>,
escalus_tcp,<0.12983.1>,
[{event_manager,<0.12931.1>},
{server,<<"domain.example.com">>},
{username,<<"kate_can_paginate_forwards_1498">>},
{resource,<<"res1">>}],
[{event_client,
[{event_manager,<0.12931.1>},
{server,<<"domain.example.com">>},
{username,<<"kate_can_paginate_forwards_1498">>},
{resource,<<"res1">>}]},
{resource,<<"res1">>},
{username,<<"kate_can_paginate_forwards_1498">>},
{server,<<"domain.example.com">>},
{host,<<"localhost">>},
{port,5222},
{auth,{escalus_auth,auth_plain}},
{wspath,undefined},
{username,<<"kate_can_paginate_forwards_1498">>},
{server,<<"domain.example.com">>},
{host,<<"localhost">>},
{password,<<"makrowe;p">>},
{stream_id,<<"34481132be694b12">>}]},
5000],
[{file,
"/home/circleci/project/big_tests/_build/default/lib/escalus/src/escalus_client.erl"},
{line,136}]},
{inbox_helper,'-given_conversations_between/2-fun-1-',4,
[{file,"/home/circleci/project/big_tests/tests/inbox_helper.erl"},
{line,543}]},
{lists,foldl_1,3,[{file,"lists.erl"},{line,1355}]},
{inbox_extensions_SUI... inbox_extensions_SUITE:regular:one_to_one:pagination:pagination_overrides_form{error,
{timeout_when_waiting_for_stanza,
[{escalus_client,wait_for_stanza,
[{client,
<<"[email protected]/res1">>,
escalus_tcp,<0.12985.1>,
[{event_manager,<0.12945.1>},
{server,<<"domain.example.com">>},
{username,<<"kate_pagination_overrides_form_1500">>},
{resource,<<"res1">>}],
[{event_client,
[{event_manager,<0.12945.1>},
{server,<<"domain.example.com">>},
{username,<<"kate_pagination_overrides_form_1500">>},
{resource,<<"res1">>}]},
{resource,<<"res1">>},
{username,<<"kate_pagination_overrides_form_1500">>},
{server,<<"domain.example.com">>},
{host,<<"localhost">>},
{port,5222},
{auth,{escalus_auth,auth_plain}},
{wspath,undefined},
{username,<<"kate_pagination_overrides_form_1500">>},
{server,<<"domain.example.com">>},
{host,<<"localhost">>},
{password,<<"makrowe;p">>},
{stream_id,<<"241a2cca05d1e2c2">>}]},
5000],
[{file,
"/home/circleci/project/big_tests/_build/default/lib/escalus/src/escalus_client.erl"},
{line,136}]},
{inbox_helper,'-given_conversations_between/2-fun-1-',4,
[{file,"/home/circleci/project/big_tests/tests/inbox_helper.erl"},
{line,543}]},
{lists,foldl_1,3,[{file,"lists.erl"},{line,1355}]},
{... inbox_extensions_SUITE:regular:one_to_one:pagination:max_queries_can_fetch_ahead{error,
{timeout_when_waiting_for_stanza,
[{escalus_client,wait_for_stanza,
[{client,
<<"[email protected]/res1">>,
escalus_tcp,<0.12987.1>,
[{event_manager,<0.12959.1>},
{server,<<"domain.example.com">>},
{username,<<"kate_max_queries_can_fetch_ahead_1502">>},
{resource,<<"res1">>}],
[{event_client,
[{event_manager,<0.12959.1>},
{server,<<"domain.example.com">>},
{username,<<"kate_max_queries_can_fetch_ahead_1502">>},
{resource,<<"res1">>}]},
{resource,<<"res1">>},
{username,<<"kate_max_queries_can_fetch_ahead_1502">>},
{server,<<"domain.example.com">>},
{host,<<"localhost">>},
{port,5222},
{auth,{escalus_auth,auth_plain}},
{wspath,undefined},
{username,<<"kate_max_queries_can_fetch_ahead_1502">>},
{server,<<"domain.example.com">>},
{host,<<"localhost">>},
{password,<<"makrowe;p">>},
{stream_id,<<"37a839c8a32df4e9">>}]},
5000],
[{file,
"/home/circleci/project/big_tests/_build/default/lib/escalus/src/escalus_client.erl"},
{line,136}]},
{inbox_helper,'-given_conversations_between/2-fun-1-',4,
[{file,"/home/circleci/project/big_tests/tests/inbox_helper.erl"},
{line,543}]},
{lists,foldl_1,3,[{file,"lists.erl"},{line,1355}... inbox_extensions_SUITE:regular:one_to_one:pagination:max_queries_can_be_limited{error,
{timeout_when_waiting_for_stanza,
[{escalus_client,wait_for_stanza,
[{client,
<<"[email protected]/res1">>,
escalus_tcp,<0.12984.1>,
[{event_manager,<0.12952.1>},
{server,<<"domain.example.com">>},
{username,<<"kate_max_queries_can_be_limited_1501">>},
{resource,<<"res1">>}],
[{event_client,
[{event_manager,<0.12952.1>},
{server,<<"domain.example.com">>},
{username,<<"kate_max_queries_can_be_limited_1501">>},
{resource,<<"res1">>}]},
{resource,<<"res1">>},
{username,<<"kate_max_queries_can_be_limited_1501">>},
{server,<<"domain.example.com">>},
{host,<<"localhost">>},
{port,5222},
{auth,{escalus_auth,auth_plain}},
{wspath,undefined},
{username,<<"kate_max_queries_can_be_limited_1501">>},
{server,<<"domain.example.com">>},
{host,<<"localhost">>},
{password,<<"makrowe;p">>},
{stream_id,<<"8899be943eaa8885">>}]},
5000],
[{file,
"/home/circleci/project/big_tests/_build/default/lib/escalus/src/escalus_client.erl"},
{line,136}]},
{inbox_helper,'-given_conversations_between/2-fun-1-',4,
[{file,"/home/circleci/project/big_tests/tests/inbox_helper.erl"},
{line,543}]},
{lists,foldl_1,3,[{file,"lists.erl"},{line,1355}]},
... riak_mnesia_24 / riak_mnesia / 05322df internal_mnesia_25 / internal_mnesia / 05322df elasticsearch_and_cassandra_25 / elasticsearch_and_cassandra_mnesia / 05322df pgsql_mnesia_25 / pgsql_mnesia / 05322df mysql_redis_25 / mysql_redis / 05322df mssql_mnesia_25 / odbc_mssql_mnesia / 05322df dynamic_domains_mssql_mnesia_25 / odbc_mssql_mnesia / 05322df dynamic_domains_mysql_redis_25 / mysql_redis / 05322df |
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.
All clear, good one 👌🏽
The goal is to enable PEP tests for
mongoose_c2s
. This required implementing missing parts of pubsub and caps, that were present directly in the legacyc2s
implementation.Functional changes:
foreign_event
andgen_statem:call
to call the functionality that requires c2s state data. The PEP-related function are still implemented as hooks, becausemod_caps
shouldn't be called directly from another module. As little as possible is delegated to the c2s processes.gen_statem
calls, because they were deadlock traps.Test changes:
timer:sleep
and shouldn't fail randomly anymore. Some functionality is fixed, and remaining race conditions are handled explicitly.Left for the future - out of scope for now:
mongoose_c2s
to prevent callinggen_statem
with infinite timeout.gen_statem
calls in favor of requests. Alternatively,mod_caps
could use mnesia table, even the session one, because the cached caps are propagated with presences, which makes them often inconsistent, and causes race conditions and unexpected behaviour (described in tests).Follow-up stories can be groomed.