Repository navigation
Enable selected rabbit exchanges - #4576
Conversation
This comment was marked as outdated.
This comment was marked as outdated.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #4576 +/- ##
==========================================
+ Coverage 85.91% 86.02% +0.11%
==========================================
Files 565 565
Lines 33888 33877 -11
==========================================
+ Hits 29114 29143 +29
+ Misses 4774 4734 -40 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Also, refactor verification for created exchanges: - Use the new error format - Report failed exchanges with errors instead of all exchanges
Also, refactor push_event/2, improving code reuse.
b82a84b to
9504ad7
Compare
This comment was marked as outdated.
This comment was marked as outdated.
Without this, workers were killed with no chance for cleanup, resulting in a flood of errors during mod_event_pusher_rabbit_SUITE, and missed instrumentation events as well.
The test case was waiting only for the 'sent' event, while it should also wait for the 'recv' one. As a result, the test was flaky. It wasn't failing on CI, but minor changes to the source code could make it fail locally.
This is done for all other suites, and it facilitates debugging.
- Type specs were incorrect - There was a redundant case + throw (wait_helper does this already)
With only presence_exchange, verify that: - Only the enabled exchange is created. - There are no push attempts for chat messages. Other combinations are not tested to reduce the number of tests.
This commit actually enables the whole feature for the user.
Update migration guide as well
9504ad7 to
e108f0d
Compare
|
elasticsearch_and_cassandra_28 / elasticsearch_and_cassandra_mnesia / e108f0d small_tests_28 / small_tests / e108f0d small_tests_27 / small_tests / e108f0d small_tests_28_arm64 / small_tests / e108f0d ldap_mnesia_27 / ldap_mnesia / e108f0d ldap_mnesia_28 / ldap_mnesia / e108f0d dynamic_domains_mysql_redis_28 / mysql_redis / e108f0d dynamic_domains_pgsql_mnesia_28 / pgsql_mnesia / e108f0d dynamic_domains_pgsql_mnesia_27 / pgsql_mnesia / e108f0d internal_mnesia_28 / internal_mnesia / e108f0d pgsql_cets_28 / pgsql_cets / e108f0d dynamic_domains_mssql_mnesia_28 / odbc_mssql_mnesia / e108f0d graphql_session_SUITE:admin_session:admin_session_cli:admin_list_users_with_status{error,
{{assertEqual,
[{module,graphql_session_SUITE},
{line,591},
{expression,"lists : sort ( ActualJIDs )"},
{expected,
[<<"alice_admin_list_users_with_status_2029@domain.example.org/res1">>]},
{value,[]}]},
[{graphql_session_SUITE,check_users,2,
[{file,
"/home/circleci/project/big_tests/tests/graphql_session_SUITE.erl"},
{line,591}]},
{graphql_session_SUITE,admin_list_users_with_status_story,3,
[{file,
"/home/circleci/project/big_tests/tests/graphql_session_SUITE.erl"},
{line,422}]},
{escalus_story,story,4,
[{file,
"/home/circleci/project/big_tests/_build/default/lib/escalus/src/escalus_story.erl"},
{line,75}]},
{test_server,ts_tc,3,[{file,"test_server.erl"},{line,1796}]},
{test_server,run_test_case_eval1,6,
[{file,"test_server.erl"},{line,1305}]},
{test_server,run_test_case_eval,9,
[{file,"test_server.erl"},{line,1237}]}]}}pgsql_mnesia_27 / pgsql_mnesia / e108f0d pgsql_mnesia_28 / pgsql_mnesia / e108f0d mysql_redis_28 / mysql_redis / e108f0d cockroachdb_cets_28 / cockroachdb_cets / e108f0d pubsub_SUITE:dag+last_item_cache:send_last_published_item_no_items_test{error,
{timeout_when_waiting_for_stanza,
[{escalus_client,wait_for_stanza,
[{client,
<<"alice_send_last_published_item_no_items_test_3729@localhost/res1">>,
escalus_tcp,<0.115752.0>,
[{event_manager,<0.115749.0>},
{server,<<"localhost">>},
{username,
<<"alicE_send_last_published_item_no_items_test_3729">>},
{resource,<<"res1">>}],
[{event_client,
[{event_manager,<0.115749.0>},
{server,<<"localhost">>},
{username,
<<"alicE_send_last_published_item_no_items_test_3729">>},
{resource,<<"res1">>}]},
{resource,<<"res1">>},
{username,
<<"alice_send_last_published_item_no_items_test_3729">>},
{server,<<"localhost">>},
{host,<<"localhost">>},
{port,5222},
{auth,fun escalus_auth:auth_plain/2},
{wspath,undefined},
{username,
<<"alicE_send_last_published_item_no_items_test_3729">>},
{server,<<"localhost">>},
{password,<<"matygrysa">>},
{stream_id,<<"f0ec5a21c883d0d3">>}]},
5000],
[{file,
"/home/circleci/project/big_tests/_build/default/lib/escalus/src/escalus_client.erl"},
{line,136}]},
{pubsub_tools,receive_response,3,
[{file,"/home/circleci/project/big_tests/tests/pubsub_tools.erl"},
{line,444}]},
{pubsub_tools,receive_and_c...pubsub_SUITE:dag+last_item_cache:send_last_published_item_no_items_test{error,
{timeout_when_waiting_for_stanza,
[{escalus_client,wait_for_stanza,
[{client,
<<"alice_send_last_published_item_no_items_test_3731@localhost/res1">>,
escalus_tcp,<0.115828.0>,
[{event_manager,<0.115817.0>},
{server,<<"localhost">>},
{username,
<<"alicE_send_last_published_item_no_items_test_3731">>},
{resource,<<"res1">>}],
[{event_client,
[{event_manager,<0.115817.0>},
{server,<<"localhost">>},
{username,
<<"alicE_send_last_published_item_no_items_test_3731">>},
{resource,<<"res1">>}]},
{resource,<<"res1">>},
{username,
<<"alice_send_last_published_item_no_items_test_3731">>},
{server,<<"localhost">>},
{host,<<"localhost">>},
{port,5222},
{auth,fun escalus_auth:auth_plain/2},
{wspath,undefined},
{username,
<<"alicE_send_last_published_item_no_items_test_3731">>},
{server,<<"localhost">>},
{password,<<"matygrysa">>},
{stream_id,<<"a22a07307d90c75e">>}]},
5000],
[{file,
"/home/circleci/project/big_tests/_build/default/lib/escalus/src/escalus_client.erl"},
{line,136}]},
{pubsub_tools,receive_response,3,
[{file,"/home/circleci/project/big_tests/tests/pubsub_tools.erl"},
{line,444}]},
{pubsub_tools,receive_and_c...pubsub_SUITE:dag+last_item_cache:send_last_published_item_no_items_test{error,
{timeout_when_waiting_for_stanza,
[{escalus_client,wait_for_stanza,
[{client,
<<"alice_send_last_published_item_no_items_test_3735@localhost/res1">>,
escalus_tcp,<0.115905.0>,
[{event_manager,<0.115903.0>},
{server,<<"localhost">>},
{username,
<<"alicE_send_last_published_item_no_items_test_3735">>},
{resource,<<"res1">>}],
[{event_client,
[{event_manager,<0.115903.0>},
{server,<<"localhost">>},
{username,
<<"alicE_send_last_published_item_no_items_test_3735">>},
{resource,<<"res1">>}]},
{resource,<<"res1">>},
{username,
<<"alice_send_last_published_item_no_items_test_3735">>},
{server,<<"localhost">>},
{host,<<"localhost">>},
{port,5222},
{auth,fun escalus_auth:auth_plain/2},
{wspath,undefined},
{username,
<<"alicE_send_last_published_item_no_items_test_3735">>},
{server,<<"localhost">>},
{password,<<"matygrysa">>},
{stream_id,<<"7c1f716a9ea236d5">>}]},
5000],
[{file,
"/home/circleci/project/big_tests/_build/default/lib/escalus/src/escalus_client.erl"},
{line,136}]},
{pubsub_tools,receive_response,3,
[{file,"/home/circleci/project/big_tests/tests/pubsub_tools.erl"},
{line,444}]},
{pubsub_tools,receive_and_c...pubsub_SUITE:dag+last_item_cache:send_last_published_item_no_items_test{error,
{timeout_when_waiting_for_stanza,
[{escalus_client,wait_for_stanza,
[{client,
<<"alice_send_last_published_item_no_items_test_3738@localhost/res1">>,
escalus_tcp,<0.115983.0>,
[{event_manager,<0.115980.0>},
{server,<<"localhost">>},
{username,
<<"alicE_send_last_published_item_no_items_test_3738">>},
{resource,<<"res1">>}],
[{event_client,
[{event_manager,<0.115980.0>},
{server,<<"localhost">>},
{username,
<<"alicE_send_last_published_item_no_items_test_3738">>},
{resource,<<"res1">>}]},
{resource,<<"res1">>},
{username,
<<"alice_send_last_published_item_no_items_test_3738">>},
{server,<<"localhost">>},
{host,<<"localhost">>},
{port,5222},
{auth,fun escalus_auth:auth_plain/2},
{wspath,undefined},
{username,
<<"alicE_send_last_published_item_no_items_test_3738">>},
{server,<<"localhost">>},
{password,<<"matygrysa">>},
{stream_id,<<"f422f5ad40a56cdd">>}]},
5000],
[{file,
"/home/circleci/project/big_tests/_build/default/lib/escalus/src/escalus_client.erl"},
{line,136}]},
{pubsub_tools,receive_response,3,
[{file,"/home/circleci/project/big_tests/tests/pubsub_tools.erl"},
{line,444}]},
{pubsub_tools,receive_and_c...pubsub_SUITE:tree+last_item_cache:send_last_published_item_no_items_test{error,
{timeout_when_waiting_for_stanza,
[{escalus_client,wait_for_stanza,
[{client,
<<"alice_send_last_published_item_no_items_test_3791@localhost/res1">>,
escalus_tcp,<0.117265.0>,
[{event_manager,<0.117246.0>},
{server,<<"localhost">>},
{username,
<<"alicE_send_last_published_item_no_items_test_3791">>},
{resource,<<"res1">>}],
[{event_client,
[{event_manager,<0.117246.0>},
{server,<<"localhost">>},
{username,
<<"alicE_send_last_published_item_no_items_test_3791">>},
{resource,<<"res1">>}]},
{resource,<<"res1">>},
{username,
<<"alice_send_last_published_item_no_items_test_3791">>},
{server,<<"localhost">>},
{host,<<"localhost">>},
{port,5222},
{auth,fun escalus_auth:auth_plain/2},
{wspath,undefined},
{username,
<<"alicE_send_last_published_item_no_items_test_3791">>},
{server,<<"localhost">>},
{password,<<"matygrysa">>},
{stream_id,<<"e0f928393900591c">>}]},
5000],
[{file,
"/home/circleci/project/big_tests/_build/default/lib/escalus/src/escalus_client.erl"},
{line,136}]},
{pubsub_tools,receive_response,3,
[{file,"/home/circleci/project/big_tests/tests/pubsub_tools.erl"},
{line,444}]},
{pubsub_tools,receive_and_c...mssql_mnesia_28 / odbc_mssql_mnesia / e108f0d elasticsearch_and_cassandra_28 / elasticsearch_and_cassandra_mnesia / e108f0d dynamic_domains_mysql_redis_28 / mysql_redis / e108f0d dynamic_domains_pgsql_mnesia_28 / pgsql_mnesia / e108f0d ldap_mnesia_28 / ldap_mnesia / e108f0d internal_mnesia_28 / internal_mnesia / e108f0d pgsql_cets_28 / pgsql_cets / e108f0d dynamic_domains_mssql_mnesia_28 / odbc_mssql_mnesia / e108f0d ldap_mnesia_27 / ldap_mnesia / e108f0d dynamic_domains_pgsql_mnesia_27 / pgsql_mnesia / e108f0d small_tests_28 / small_tests / e108f0d small_tests_27 / small_tests / e108f0d small_tests_28_arm64 / small_tests / e108f0d small_tests_28 / small_tests / e108f0d elasticsearch_and_cassandra_28 / elasticsearch_and_cassandra_mnesia / e108f0d small_tests_28_arm64 / small_tests / e108f0d small_tests_28 / small_tests / e108f0d small_tests_27 / small_tests / e108f0d ldap_mnesia_27 / ldap_mnesia / e108f0d dynamic_domains_mysql_redis_28 / mysql_redis / e108f0d ldap_mnesia_28 / ldap_mnesia / e108f0d dynamic_domains_pgsql_mnesia_28 / pgsql_mnesia / e108f0d internal_mnesia_28 / internal_mnesia / e108f0d dynamic_domains_pgsql_mnesia_27 / pgsql_mnesia / e108f0d pgsql_cets_28 / pgsql_cets / e108f0d dynamic_domains_mssql_mnesia_28 / odbc_mssql_mnesia / e108f0d connect_SUITE:just_tls:tls:should_fail_without_tls{error,{{assertEqual,[{module,connect_SUITE},
{line,394},
{expression,"logger_ct_backend : recv ( fun ( _ , _Msg ) -> true end )"},
{expected,[]},
{value,[{error,"2025-11-18T16:26:16.644976+00:00 error: State machine <0.21677.0> terminating. Reason: {badmatch,{error,einval}}. Stack: [{mongoose_listener,read_connection_details,3,[{file,\"/home/circleci/project/src/listeners/mongoose_listener.erl\"},{line,219}]},{mongoose_xmpp_socket,accept,4,[{file,\"/home/circleci/project/src/listeners/mongoose_xmpp_socket.erl\"},{line,92}]},{mongoose_c2s,handle_event,4,[{file,\"/home/circleci/project/src/c2s/mongoose_c2s.erl\"},{line,94}]},{gen_statem,loop_state_callback,11,[{file,\"gen_statem.erl\"},{line,3750}]},{proc_lib,init_p_do_apply,3,[{file,\"proc_lib.erl\"},{line,333}]}]. Last event: {internal,{connect,{ranch_ssl,{5222,{0,0,0,0},tcp}}}}. State: {connect,{c2s_data,undefined,<<\"localhost\">>,<<\"en\">>,{1763483176639213,<0.21677.0>},<<\"127f0ccea3632210\">>,undefined,undefined,undefined,undefined,#{access => c2s,module => mongoose_c2s_listener,port => 5222,num_acceptors => 100,max_connections => infinity,hibernate_after => 0,backlog => 1024,state_timeout => 5000,tls => #{mode => tls,cacertfile => \"priv/ssl/cacert.pem\",certfile => \"priv/ssl/fake_cert.pem\",keyfile => \"priv/ssl/fake_key.pem\",dhfile => \"priv/ssl/fake_dh_server.pem\",verify_mode => none,crl_files => [],disconnect_on_failure => true},shaper => normal,connection_type =>...small_tests_27 / small_tests / e108f0d small_tests_28_arm64 / small_tests / e108f0d ldap_mnesia_27 / ldap_mnesia / e108f0d dynamic_domains_mssql_mnesia_28 / odbc_mssql_mnesia / e108f0d |
This PR makes it possible to enable selected RabbitMQ exchanges in
mod_event_pusher_rabbitinstead of having them always enabled.Main changes:
presence_exchange) is enabled. We could test other options, but the tests are sequential, and I decided not to create too many of them. After all, the functionality is provided by the same code, so it makes sense to only hit the lines once.Other changes:
mod_event_pusher_rabbitand the big tests. The goal is to make the code easier to extend and maintain.mod_event_pusher_rabbit_SUITE. They were caused by the pools being brutally killed when restarted. I gave them a sane shutdown timeout of 5 seconds.Notes:
rdbmspools have an inifite shutdown timeout, while other pools have the defaultbrutal_killstrategy. It is worth investigating this further. The priority is not high, because restarting pools shouldn't happen during normal operation.More details in commit messages.