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

optimize: optimize the tests of SAGA #4354

Merged
merged 31 commits into from
Feb 15, 2022

Conversation

wangliang181230
Copy link
Contributor

@wangliang181230 wangliang181230 commented Jan 29, 2022

  1. 优化 SAGA 相关的测试的日志,方便查看单测的耗时。
  2. 优化 SAGA 测试用例中,callback和wait的代码。每个单测独立使用一个Object来进行wait和notifyAll.
  3. 部分 SAGA 的单测中,sleep时间减半,减少单测耗时,由原来的1112分钟,降低到了89分钟。
  4. github/actions,使用多线程并行构建来完成测试:mvn -T 4C clean install

另外:

  1. antrun 插件,只在 release-seatareleaseprofile 下才执行,在单测时,这个插件出现过卡死的情况。
  2. 将使用不当的 assertTrue 调整为 assertEquals,方便观察实际值。
  3. 部分 assertEquals预期值实际值 传参反了。

@codecov-commenter
Copy link

codecov-commenter commented Jan 29, 2022

Codecov Report

Merging #4354 (3bbef93) into develop (f1be649) will increase coverage by 0.08%.
The diff coverage is 79.76%.

Impacted file tree graph

@@              Coverage Diff              @@
##             develop    #4354      +/-   ##
=============================================
+ Coverage      48.85%   48.94%   +0.08%     
- Complexity      3935     3953      +18     
=============================================
  Files            733      733              
  Lines          24900    24968      +68     
  Branches        3068     3087      +19     
=============================================
+ Hits           12166    12220      +54     
- Misses         11452    11453       +1     
- Partials        1282     1295      +13     
Impacted Files Coverage Δ
...c/main/java/io/seata/common/ConfigurationKeys.java 0.00% <ø> (ø)
...ommon/src/main/java/io/seata/common/Constants.java 100.00% <ø> (ø)
...er/console/controller/BranchSessionController.java 100.00% <ø> (ø)
...in/java/io/seata/server/session/BranchSession.java 79.16% <ø> (-0.15%) ⬇️
...ver/storage/db/lock/DataBaseDistributedLocker.java 0.86% <0.00%> (ø)
.../server/store/AbstractTransactionStoreManager.java 33.33% <0.00%> (-6.67%) ⬇️
...io/seata/server/store/TransactionStoreManager.java 86.66% <ø> (ø)
...ava/io/seata/server/transaction/saga/SagaCore.java 2.72% <ø> (ø)
...in/java/io/seata/server/session/SessionHolder.java 51.44% <50.00%> (-0.05%) ⬇️
...o/seata/server/storage/redis/lock/RedisLocker.java 37.43% <62.50%> (-0.14%) ⬇️
... and 16 more

@wangliang181230 wangliang181230 changed the title 尝试解决saga单元测试的问题 test: optimize tests, and temporarily disable SAGA tests with frequent errors Jan 29, 2022
@slievrly slievrly added the module/saga saga module label Feb 10, 2022
@slievrly slievrly added the maven label Feb 10, 2022
Copy link
Contributor

@long187 long187 left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

@funky-eyes funky-eyes left a comment

Choose a reason for hiding this comment

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

LGTM

@wangliang181230 wangliang181230 changed the title test: optimize tests, and temporarily disable SAGA tests with frequent errors test: optimize the tests of SAGA Feb 14, 2022
@wangliang181230 wangliang181230 changed the title test: optimize the tests of SAGA optimize: optimize the tests of SAGA Feb 14, 2022
@slievrly slievrly merged commit ca8ff3f into apache:develop Feb 15, 2022
@slievrly slievrly added this to the 1.5.0 milestone Feb 15, 2022
@wangliang181230 wangliang181230 deleted the optimize-test branch February 15, 2022 06:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants