Skip to content
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

Simplify stream management suite #3453

Merged
merged 26 commits into from
Dec 17, 2021
Merged

Simplify stream management suite #3453

merged 26 commits into from
Dec 17, 2021

Conversation

arcusfelis
Copy link
Contributor

@arcusfelis arcusfelis commented Dec 14, 2021

Proposed changes include:

  • Remove code duplication by introducing a function connect_fresh and connect_spec.
  • Explicitly specify which cases use manual_ack, when creating a connection
  • Make sm_helper module with helpers

Motivation:

  • that suite contains a lot of escalus_connection:connect calls. And 3 lines syntax makes harder to compare test cases.

Reduce complexity to keep in mind that:

  • sm is enabled in test.config, unless we provide steps separately.
  • manual_ack could be specified in the group settings or in test cases. Once we starting to pass Spec, it is harder to keep in mind which connections need manual acking.
  • connections_steps_to_something is harder to read comparing to just something.
  • a separate sm_helper allows to focus just on test cases and CT init logic.

@mongoose-im

This comment has been minimized.

@codecov
Copy link

codecov bot commented Dec 14, 2021

Codecov Report

Merging #3453 (0538006) into master (96f2fd6) will decrease coverage by 0.01%.
The diff coverage is n/a.

❗ Current head 0538006 differs from pull request most recent head 7bb63ff. Consider uploading reports for the commit 7bb63ff to get more accurate results
Impacted file tree graph

@@            Coverage Diff             @@
##           master    #3453      +/-   ##
==========================================
- Coverage   80.86%   80.84%   -0.02%     
==========================================
  Files         415      415              
  Lines       32312    32312              
==========================================
- Hits        26129    26124       -5     
- Misses       6183     6188       +5     
Impacted Files Coverage Δ
src/cassandra/mongoose_cassandra.erl 77.77% <0.00%> (-3.71%) ⬇️
src/mod_private.erl 79.66% <0.00%> (-3.39%) ⬇️
src/cassandra/mongoose_cassandra_worker.erl 65.72% <0.00%> (-2.82%) ⬇️
src/logger/mongoose_log_filter.erl 78.08% <0.00%> (-1.37%) ⬇️
src/rdbms/mongoose_rdbms.erl 62.94% <0.00%> (-0.80%) ⬇️
src/ejabberd_c2s.erl 89.34% <0.00%> (-0.08%) ⬇️
src/pubsub/mod_pubsub.erl 73.13% <0.00%> (-0.06%) ⬇️
src/mod_muc_log.erl 78.11% <0.00%> (ø)
src/pubsub/mod_pubsub_db_rdbms.erl 95.34% <0.00%> (+0.25%) ⬆️
src/mod_muc_room.erl 77.09% <0.00%> (+0.34%) ⬆️
... and 1 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 96f2fd6...7bb63ff. Read the comment docs.

@mongoose-im

This comment has been minimized.

Copy link
Collaborator

@NelsonVides NelsonVides left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Amazing clean-up, thank you!
Just a few comments below :)

big_tests/tests/mongoose_helper.erl Outdated Show resolved Hide resolved
big_tests/tests/mongoose_helper.erl Outdated Show resolved Hide resolved
big_tests/tests/sm_SUITE.erl Outdated Show resolved Hide resolved
@mongoose-im

This comment has been minimized.

@mongoose-im

This comment has been minimized.

@arcusfelis arcusfelis force-pushed the mu-simplify-sm-suite branch 2 times, most recently from bc0c50b to 2dafd14 Compare December 16, 2021 00:06
@mongoose-im

This comment has been minimized.

@mongoose-im

This comment has been minimized.

@mongoose-im
Copy link
Collaborator

mongoose-im commented Dec 16, 2021

small_tests_24 / small_tests / 9a15e27
Reports root / small


small_tests_23 / small_tests / 9a15e27
Reports root / small


dynamic_domains_pgsql_mnesia_23 / pgsql_mnesia / 9a15e27
Reports root/ big
OK: 2727 / Failed: 0 / User-skipped: 186 / Auto-skipped: 0


dynamic_domains_mysql_redis_24 / mysql_redis / 9a15e27
Reports root/ big
OK: 2710 / Failed: 0 / User-skipped: 203 / Auto-skipped: 0


dynamic_domains_pgsql_mnesia_24 / pgsql_mnesia / 9a15e27
Reports root/ big
OK: 2727 / Failed: 0 / User-skipped: 186 / Auto-skipped: 0


dynamic_domains_mssql_mnesia_24 / odbc_mssql_mnesia / 9a15e27
Reports root/ big
OK: 2727 / Failed: 0 / User-skipped: 186 / Auto-skipped: 0


ldap_mnesia_23 / ldap_mnesia / 9a15e27
Reports root/ big
OK: 1503 / Failed: 0 / User-skipped: 386 / Auto-skipped: 0


ldap_mnesia_24 / ldap_mnesia / 9a15e27
Reports root/ big
OK: 1503 / Failed: 0 / User-skipped: 386 / Auto-skipped: 0


internal_mnesia_24 / internal_mnesia / 9a15e27
Reports root/ big
OK: 1588 / Failed: 0 / User-skipped: 301 / Auto-skipped: 0


elasticsearch_and_cassandra_24 / elasticsearch_and_cassandra_mnesia / 9a15e27
Reports root/ big
OK: 1881 / Failed: 0 / User-skipped: 313 / Auto-skipped: 0


mysql_redis_24 / mysql_redis / 9a15e27
Reports root/ big
OK: 3109 / Failed: 0 / User-skipped: 200 / Auto-skipped: 0


pgsql_mnesia_23 / pgsql_mnesia / 9a15e27
Reports root/ big
OK: 3114 / Failed: 0 / User-skipped: 195 / Auto-skipped: 0


pgsql_mnesia_24 / pgsql_mnesia / 9a15e27
Reports root/ big
OK: 3114 / Failed: 0 / User-skipped: 195 / Auto-skipped: 0


mssql_mnesia_24 / odbc_mssql_mnesia / 9a15e27
Reports root/ big
OK: 3114 / Failed: 0 / User-skipped: 195 / Auto-skipped: 0


riak_mnesia_24 / riak_mnesia / 9a15e27
Reports root/ big
OK: 1727 / Failed: 0 / User-skipped: 314 / Auto-skipped: 0

Comment on lines 211 to 217
receive
{'DOWN', MRef, _Type, _C2SPid, _Info} ->
ok
after 5000 ->
ct:fail(wait_for_process_termination_timeout)
end,
ok.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
receive
{'DOWN', MRef, _Type, _C2SPid, _Info} ->
ok
after 5000 ->
ct:fail(wait_for_process_termination_timeout)
end,
ok.
receive
{'DOWN', MRef, _Type, _C2SPid, _Info} ->
ok
after 5000 ->
ct:fail(wait_for_process_termination_timeout)
end.

@@ -1,22 +1,38 @@
%% Session Management tests
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not needed

Suggested change
%% Session Management tests

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

omg, actually needed.
It is Stream Management.

There are two things called SM in MongooseIM (Stream and Session).

@mongoose-im
Copy link
Collaborator

mongoose-im commented Dec 17, 2021

small_tests_24 / small_tests / 0538006
Reports root / small


small_tests_23 / small_tests / 0538006
Reports root / small


dynamic_domains_pgsql_mnesia_23 / pgsql_mnesia / 0538006
Reports root/ big
OK: 2727 / Failed: 0 / User-skipped: 186 / Auto-skipped: 0


dynamic_domains_pgsql_mnesia_24 / pgsql_mnesia / 0538006
Reports root/ big
OK: 2727 / Failed: 0 / User-skipped: 186 / Auto-skipped: 0


dynamic_domains_mssql_mnesia_24 / odbc_mssql_mnesia / 0538006
Reports root/ big
OK: 2727 / Failed: 0 / User-skipped: 186 / Auto-skipped: 0


dynamic_domains_mysql_redis_24 / mysql_redis / 0538006
Reports root/ big
OK: 2710 / Failed: 0 / User-skipped: 203 / Auto-skipped: 0


ldap_mnesia_23 / ldap_mnesia / 0538006
Reports root/ big
OK: 1503 / Failed: 0 / User-skipped: 386 / Auto-skipped: 0


ldap_mnesia_24 / ldap_mnesia / 0538006
Reports root/ big
OK: 1503 / Failed: 0 / User-skipped: 386 / Auto-skipped: 0


internal_mnesia_24 / internal_mnesia / 0538006
Reports root/ big
OK: 1588 / Failed: 0 / User-skipped: 301 / Auto-skipped: 0


pgsql_mnesia_24 / pgsql_mnesia / 0538006
Reports root/ big
OK: 3114 / Failed: 0 / User-skipped: 195 / Auto-skipped: 0


elasticsearch_and_cassandra_24 / elasticsearch_and_cassandra_mnesia / 0538006
Reports root/ big
OK: 1881 / Failed: 0 / User-skipped: 313 / Auto-skipped: 0


pgsql_mnesia_23 / pgsql_mnesia / 0538006
Reports root/ big
OK: 3114 / Failed: 0 / User-skipped: 195 / Auto-skipped: 0


mssql_mnesia_24 / odbc_mssql_mnesia / 0538006
Reports root/ big
OK: 3114 / Failed: 0 / User-skipped: 195 / Auto-skipped: 0


mysql_redis_24 / mysql_redis / 0538006
Reports root/ big
OK: 3109 / Failed: 0 / User-skipped: 200 / Auto-skipped: 0


riak_mnesia_24 / riak_mnesia / 0538006
Reports root/ big
OK: 1727 / Failed: 0 / User-skipped: 314 / Auto-skipped: 0

Enable preserve_order testcase (it was not running)
Fix resume_expired_session_returns_correct_h
Define suite() callback first
The proper fix would require extra tests to reproduce alternative orders
reliably and fix them
@arcusfelis arcusfelis changed the title Simplify sm suite Simplify stream management suite Dec 17, 2021
@mongoose-im
Copy link
Collaborator

mongoose-im commented Dec 17, 2021

small_tests_24 / small_tests / 7bb63ff
Reports root / small


small_tests_23 / small_tests / 7bb63ff
Reports root / small


dynamic_domains_mysql_redis_24 / mysql_redis / 7bb63ff
Reports root/ big
OK: 2707 / Failed: 0 / User-skipped: 203 / Auto-skipped: 0


dynamic_domains_pgsql_mnesia_24 / pgsql_mnesia / 7bb63ff
Reports root/ big
OK: 2724 / Failed: 0 / User-skipped: 186 / Auto-skipped: 0


dynamic_domains_mssql_mnesia_24 / odbc_mssql_mnesia / 7bb63ff
Reports root/ big
OK: 2724 / Failed: 0 / User-skipped: 186 / Auto-skipped: 0


dynamic_domains_pgsql_mnesia_23 / pgsql_mnesia / 7bb63ff
Reports root/ big
OK: 2724 / Failed: 0 / User-skipped: 186 / Auto-skipped: 0


ldap_mnesia_24 / ldap_mnesia / 7bb63ff
Reports root/ big
OK: 1500 / Failed: 0 / User-skipped: 386 / Auto-skipped: 0


internal_mnesia_24 / internal_mnesia / 7bb63ff
Reports root/ big
OK: 1585 / Failed: 0 / User-skipped: 301 / Auto-skipped: 0


ldap_mnesia_23 / ldap_mnesia / 7bb63ff
Reports root/ big
OK: 1500 / Failed: 0 / User-skipped: 386 / Auto-skipped: 0


elasticsearch_and_cassandra_24 / elasticsearch_and_cassandra_mnesia / 7bb63ff
Reports root/ big
OK: 1878 / Failed: 0 / User-skipped: 313 / Auto-skipped: 0


pgsql_mnesia_24 / pgsql_mnesia / 7bb63ff
Reports root/ big
OK: 3111 / Failed: 0 / User-skipped: 195 / Auto-skipped: 0


mysql_redis_24 / mysql_redis / 7bb63ff
Reports root/ big
OK: 3106 / Failed: 0 / User-skipped: 200 / Auto-skipped: 0


mssql_mnesia_24 / odbc_mssql_mnesia / 7bb63ff
Reports root/ big
OK: 3111 / Failed: 0 / User-skipped: 195 / Auto-skipped: 0


pgsql_mnesia_23 / pgsql_mnesia / 7bb63ff
Reports root/ big
OK: 3111 / Failed: 0 / User-skipped: 195 / Auto-skipped: 0


riak_mnesia_24 / riak_mnesia / 7bb63ff
Reports root/ big
OK: 1724 / Failed: 0 / User-skipped: 314 / Auto-skipped: 0

Copy link
Collaborator

@NelsonVides NelsonVides left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Excellent 👌🏽

@NelsonVides NelsonVides merged commit 367f27f into master Dec 17, 2021
@NelsonVides NelsonVides deleted the mu-simplify-sm-suite branch December 17, 2021 10:59
@Premwoik Premwoik added this to the 5.1.0 milestone May 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants