Skip to content

Commit

Permalink
Merge pull request #4424 from esl/reorder-big-tests
Browse files Browse the repository at this point in the history
Move tests restarting MIM to the end
  • Loading branch information
telezynski authored Dec 12, 2024
2 parents 466f169 + e6223e7 commit 0f2536c
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 80 deletions.
2 changes: 1 addition & 1 deletion .circleci/template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ references:
# You could need to trigger a pipeline to create a Docker image:
# https://github.com/esl/cimg-erlang#trigger-build-using-trigger-pipeline-on-circleci
- &LATEST_OTP_VERSION 27.1.2
- &OTP26 erlangsolutions/erlang:cimg-26.2.5.4
- &OTP26 erlangsolutions/erlang:cimg-26.2.5.6
- &OTP27 erlangsolutions/erlang:cimg-27.1.2
- &ENTRYPOINT ["/bin/sh", "-c", "eval ${INSTALL_DEPS_CMD:-echo} && echo __INJECT_FILES__ | eval ${BASE32DEC:-base32 --decode} | bash"]
# Caches created via the save_cache step are stored for up to 15 days
Expand Down
35 changes: 19 additions & 16 deletions big_tests/default.spec
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,9 @@
{suites, "tests", adhoc_SUITE}.
{suites, "tests", amp_big_SUITE}.
{suites, "tests", anonymous_SUITE}.
{suites, "tests", auth_methods_for_c2s_SUITE}.
{suites, "tests", bind2_SUITE}.
{suites, "tests", bosh_SUITE}.
{suites, "tests", carboncopy_SUITE}.
{suites, "tests", cluster_commands_SUITE}.
{suites, "tests", component_SUITE}.
{suites, "tests", connect_SUITE}.
{suites, "tests", disco_and_caps_SUITE}.
{suites, "tests", extdisco_SUITE}.
Expand All @@ -46,25 +43,20 @@
{suites, "tests", graphql_cets_SUITE}.
{suites, "tests", graphql_vcard_SUITE}.
{suites, "tests", graphql_http_upload_SUITE}.
{suites, "tests", graphql_server_SUITE}.
{suites, "tests", graphql_metric_SUITE}.
{suites, "tests", inbox_SUITE}.
{suites, "tests", inbox_extensions_SUITE}.
{suites, "tests", jingle_SUITE}.
{suites, "tests", last_SUITE}.
{suites, "tests", login_SUITE}.
{suites, "tests", mam_SUITE}.
{suites, "tests", mam_proper_SUITE}.
{suites, "tests", mam_send_message_SUITE}.
{suites, "tests", metrics_api_SUITE}.
{suites, "tests", metrics_c2s_SUITE}.
{suites, "tests", metrics_roster_SUITE}.
{suites, "tests", metrics_session_SUITE}.
{suites, "tests", mod_blocking_SUITE}.
{suites, "tests", mod_event_pusher_http_SUITE}.
{suites, "tests", mod_event_pusher_rabbit_SUITE}.
{suites, "tests", mod_event_pusher_sns_SUITE}.
{suites, "tests", mod_global_distrib_SUITE}.
{suites, "tests", mod_http_upload_SUITE}.
{suites, "tests", mod_ping_SUITE}.
{suites, "tests", mod_time_SUITE}.
Expand All @@ -81,7 +73,6 @@
{suites, "tests", offline_SUITE}.
{suites, "tests", offline_stub_SUITE}.
{suites, "tests", pep_SUITE}.
{suites, "tests", persistent_cluster_id_SUITE}.
{suites, "tests", presence_SUITE}.
{suites, "tests", privacy_SUITE}.
{suites, "tests", private_SUITE}.
Expand All @@ -95,30 +86,42 @@
{suites, "tests", rdbms_SUITE}.
{suites, "tests", rest_SUITE}.
{suites, "tests", rest_client_SUITE}.
{suites, "tests", s2s_SUITE}.
{suites, "tests", sasl_SUITE}.
{suites, "tests", sasl2_SUITE}.
{suites, "tests", sasl_external_SUITE}.
{suites, "tests", service_mongoose_system_metrics_SUITE}.
{suites, "tests", shared_roster_SUITE}.
{suites, "tests", sic_SUITE}.
{suites, "tests", smart_markers_SUITE}.
{suites, "tests", sm_SUITE}.
{suites, "tests", system_probes_SUITE}.
{suites, "tests", vcard_SUITE}.
{suites, "tests", vcard_simple_SUITE}.
{suites, "tests", websockets_SUITE}.
{suites, "tests", xep_0352_csi_SUITE}.
{suites, "tests", service_domain_db_SUITE}.
{suites, "tests", domain_isolation_SUITE}.
{suites, "tests", domain_removal_SUITE}.
{suites, "tests", dynamic_domains_SUITE}.
{suites, "tests", local_iq_SUITE}.
{suites, "tests", tcp_listener_SUITE}.
{suites, "tests", cets_disco_SUITE}.
{suites, "tests", start_node_id_SUITE}.
{suites, "tests", tr_util_SUITE}.

%% the below suites restart MIM nodes, so they were moved to the end
%% to minimise impact on other tests
{suites, "tests", auth_methods_for_c2s_SUITE}.
{suites, "tests", cluster_commands_SUITE}.
{suites, "tests", component_SUITE}.
{suites, "tests", dynamic_domains_SUITE}.
{suites, "tests", graphql_server_SUITE}.
{suites, "tests", jingle_SUITE}.
{suites, "tests", last_SUITE}.
{suites, "tests", local_iq_SUITE}.
{suites, "tests", metrics_api_SUITE}.
{suites, "tests", mod_global_distrib_SUITE}.
{suites, "tests", persistent_cluster_id_SUITE}.
{suites, "tests", s2s_SUITE}.
{suites, "tests", sasl_external_SUITE}.
{suites, "tests", service_domain_db_SUITE}.
{suites, "tests", service_mongoose_system_metrics_SUITE}.
{suites, "tests", shutdown_SUITE}.
{suites, "tests", system_probes_SUITE}.

{config, ["test.config"]}.
{logdir, "ct_report"}.
Expand Down
79 changes: 18 additions & 61 deletions big_tests/dynamic_domains.spec
Original file line number Diff line number Diff line change
Expand Up @@ -10,35 +10,17 @@
{include, "tests"}.

{suites, "tests", mim_c2s_SUITE}.

{suites, "tests", acc_e2e_SUITE}.

{suites, "tests", accounts_SUITE}.

{suites, "tests", adhoc_SUITE}.

{suites, "tests", amp_big_SUITE}.

{suites, "tests", anonymous_SUITE}.

{suites, "tests", auth_methods_for_c2s_SUITE}.

{suites, "tests", bind2_SUITE}.

{suites, "tests", bosh_SUITE}.

{suites, "tests", carboncopy_SUITE}.

{suites, "tests", cluster_commands_SUITE}.

{suites, "tests", connect_SUITE}.

{suites, "tests", disco_and_caps_SUITE}.

{suites, "tests", domain_isolation_SUITE}.

{suites, "tests", dynamic_domains_SUITE}.

{suites, "tests", extdisco_SUITE}.

{suites, "tests", gdpr_SUITE}.
Expand Down Expand Up @@ -67,38 +49,21 @@
{suites, "tests", graphql_mnesia_SUITE}.
{suites, "tests", graphql_cets_SUITE}.
{suites, "tests", graphql_http_upload_SUITE}.
{suites, "tests", graphql_server_SUITE}.
{suites, "tests", graphql_metric_SUITE}.

{suites, "tests", inbox_SUITE}.
{suites, "tests", inbox_extensions_SUITE}.

{suites, "tests", last_SUITE}.

{suites, "tests", login_SUITE}.

{suites, "tests", mam_SUITE}.
{suites, "tests", mam_proper_SUITE}.
{suites, "tests", mam_send_message_SUITE}.

{suites, "tests", metrics_c2s_SUITE}.

{suites, "tests", metrics_roster_SUITE}.

{suites, "tests", metrics_session_SUITE}.

{suites, "tests", metrics_api_SUITE}.

{suites, "tests", mod_blocking_SUITE}.

{suites, "tests", mod_http_upload_SUITE}.

{suites, "tests", mod_ping_SUITE}.

{suites, "tests", mod_time_SUITE}.

{suites, "tests", mod_version_SUITE}.

{suites, "tests", mongooseimctl_SUITE}.

{suites, "tests", muc_SUITE}.
Expand All @@ -108,48 +73,22 @@
"(requires mod_register creating CT users)"}.

{suites, "tests", muc_http_api_SUITE}.

{suites, "tests", muc_light_SUITE}.

{suites, "tests", muc_light_legacy_SUITE}.

{suites, "tests", muc_light_http_api_SUITE}.

{suites, "tests", oauth_SUITE}.

{suites, "tests", offline_SUITE}.

{suites, "tests", offline_stub_SUITE}.

{suites, "tests", persistent_cluster_id_SUITE}.

{suites, "tests", presence_SUITE}.

{suites, "tests", privacy_SUITE}.

{suites, "tests", private_SUITE}.

{suites, "tests", race_conditions_SUITE}.

{suites, "tests", rdbms_SUITE}.

{suites, "tests", rest_SUITE}.

{suites, "tests", rest_client_SUITE}.

{suites, "tests", sasl_SUITE}.
{suites, "tests", sasl2_SUITE}.
{suites, "tests", sasl_external_SUITE}.

{suites, "tests", service_domain_db_SUITE}.

{suites, "tests", service_mongoose_system_metrics_SUITE}.
{skip_cases, "tests", service_mongoose_system_metrics_SUITE,
[xmpp_components_are_reported],
"at the moment external components doesn't support dynamic domains"}.

{suites, "tests", sic_SUITE}.

{suites, "tests", smart_markers_SUITE}.
{suites, "tests", sm_SUITE}.
{suites, "tests", system_probes_SUITE}.
Expand All @@ -163,6 +102,24 @@
{suites, "tests", cets_disco_SUITE}.
{suites, "tests", start_node_id_SUITE}.
{suites, "tests", tr_util_SUITE}.

%% the below suites restart MIM nodes, so they were moved to the end
%% to minimise impact on other tests
{suites, "tests", auth_methods_for_c2s_SUITE}.
{suites, "tests", cluster_commands_SUITE}.
{suites, "tests", dynamic_domains_SUITE}.
{suites, "tests", graphql_server_SUITE}.
{suites, "tests", last_SUITE}.
{suites, "tests", metrics_api_SUITE}.
{suites, "tests", persistent_cluster_id_SUITE}.
{suites, "tests", sasl_external_SUITE}.
{suites, "tests", service_domain_db_SUITE}.

{suites, "tests", service_mongoose_system_metrics_SUITE}.
{skip_cases, "tests", service_mongoose_system_metrics_SUITE,
[xmpp_components_are_reported],
"at the moment external components doesn't support dynamic domains"}.

{suites, "tests", shutdown_SUITE}.

{config, ["dynamic_domains.config", "test.config"]}.
Expand Down
7 changes: 5 additions & 2 deletions src/mongoose_client_api/mongoose_client_api_sse.erl
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ routes() ->
[{"/sse", lasse_handler, #{module => mongoose_client_api_sse}}].

init(_InitArgs, _LastEvtId, Req) ->
process_flag(trap_exit, true), % needed for 'terminate' to be called
?LOG_DEBUG(#{what => client_api_sse_init, req => Req}),
{cowboy_rest, Req1, State0} = mongoose_client_api:init(Req, []),
{Authorization, Req2, State} = mongoose_client_api:is_authorized(Req1, State0),
Expand All @@ -28,7 +29,7 @@ init(_InitArgs, _LastEvtId, Req) ->
maybe_init(Authorization, Req2, State#{id => 1}).

maybe_init(true, Req, #{jid := JID} = State) ->
Session = mongoose_stanza_api:open_session(JID, false),
{ok, Session} = mongoose_stanza_api:open_session(JID, false),
{ok, Req, State#{session => Session}};
maybe_init(true, Req, State) ->
%% This is for OPTIONS method
Expand All @@ -51,7 +52,9 @@ handle_info(Msg, State) ->
handle_msg(<<"message">>, Acc, El, State) ->
Timestamp = os:system_time(microsecond),
Type = mongoose_acc:stanza_type(Acc),
maybe_send_message_event(Type, El, Timestamp, State).
maybe_send_message_event(Type, El, Timestamp, State);
handle_msg(_, _, _, State) ->
{nosend, State}.

handle_error(Msg, Reason, State) ->
?LOG_WARNING(#{what => sse_handle_error, msg => Msg, reason => Reason}),
Expand Down

0 comments on commit 0f2536c

Please sign in to comment.