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

bugfix: clean up resources in time to avoid mutual influence between unit tests #1778

Merged
merged 2 commits into from Oct 17, 2019

Conversation

ggndnn
Copy link
Contributor

@ggndnn ggndnn commented Oct 16, 2019

Ⅰ. Describe what this PR did

According to #1710's ci output, DefaultCoreForEventBusTest's thread AsyncCommitting_2_1 committed DefaultCoreForEventBusTest's session, so it's proved that more than one AsyncCommitting threads running in the same time which could case the unit test failure.

This PR tried to clean up unit tests' resources to avoid mutual influence between them.

DefaultCoordinatorMetricsTest:

[INFO] Running io.seata.server.coordinator.DefaultCoordinatorMetricsTest
2019-10-14 07:18:40.765 INFO [AsyncCommitting_2_1]io.seata.server.coordinator.DefaultCore.doGlobalCommit:303 -Global[172.17.0.1:0:1411] committing is successfully done.
2019-10-14 07:18:40.772 INFO [main]io.seata.common.loader.EnhancedServiceLoader.loadFile:236 -load Registry[Compact] extension by class[io.seata.metrics.registry.compact.CompactRegistry]
2019-10-14 07:18:40.814 INFO [main]io.seata.common.loader.EnhancedServiceLoader.loadFile:236 -load Exporter[Prometheus] extension by class[io.seata.metrics.exporter.prometheus.PrometheusExporter]
2019-10-14 07:18:40.853 INFO [main]io.seata.server.coordinator.DefaultCore.begin:145 -Successfully begin global transaction xid = 172.17.0.1:0:1416
2019-10-14 07:18:40.866 INFO [AsyncCommitting_2_1]io.seata.server.coordinator.DefaultCore.doGlobalCommit:303 -Global[172.17.0.1:0:1416] committing is successfully done.
2019-10-14 07:18:41.058 INFO [main]io.seata.server.coordinator.DefaultCore.begin:145 -Successfully begin global transaction xid = 172.17.0.1:0:1417
2019-10-14 07:18:41.060 INFO [main]io.seata.server.coordinator.DefaultCore.doGlobalRollback:437 -Successfully rollback global, xid = 172.17.0.1:0:1417
[INFO] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.507 s - in io.seata.server.coordinator.DefaultCoordinatorMetricsTest

DefaultCoreForEventBusTest:

[INFO] Running io.seata.server.event.DefaultCoreForEventBusTest
2019-10-14 07:18:41.282 INFO [main]io.seata.server.coordinator.DefaultCore.begin:145 -Successfully begin global transaction xid = 172.17.0.1:0:4024736727
2019-10-14 07:18:41.360 INFO [AsyncCommitting_2_1]io.seata.server.coordinator.DefaultCore.doGlobalCommit:303 -Global[172.17.0.1:0:4024736727] committing is successfully done.
2019-10-14 07:18:42.285 INFO [main]io.seata.server.coordinator.DefaultCore.begin:145 -Successfully begin global transaction xid = 172.17.0.1:0:4024736728
2019-10-14 07:18:42.286 INFO [main]io.seata.server.coordinator.DefaultCore.doGlobalRollback:437 -Successfully rollback global, xid = 172.17.0.1:0:4024736728
2019-10-14 07:18:42.287 INFO [main]io.seata.server.coordinator.DefaultCore.begin:145 -Successfully begin global transaction xid = 172.17.0.1:0:4024736729
2019-10-14 07:18:42.359 INFO [TxTimeoutCheck_2_1]io.seata.server.coordinator.DefaultCoordinator.timeoutCheck:353 -Global transaction[172.17.0.1:0:4024736729] is timeout and will be rolled back.
2019-10-14 07:18:42.380 INFO [RetryRollbacking_3_1]io.seata.server.coordinator.DefaultCore.doGlobalRollback:437 -Successfully rollback global, xid = 172.17.0.1:0:4024736729
[INFO] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 2.015 s - in io.seata.server.event.DefaultCoreForEventBusTest

Ⅱ. Does this pull request fix one issue?

fixes #1702

Ⅲ. Why don't you add test cases (unit test/integration test)?

Ⅳ. Describe how to verify it

Ⅴ. Special notes for reviews

@codecov-io
Copy link

codecov-io commented Oct 16, 2019

Codecov Report

Merging #1778 into develop will increase coverage by 0.3%.
The diff coverage is 100%.

Impacted file tree graph

@@             Coverage Diff              @@
##             develop    #1778     +/-   ##
============================================
+ Coverage      50.42%   50.73%   +0.3%     
- Complexity      2153     2161      +8     
============================================
  Files            414      414             
  Lines          14151    14151             
  Branches        1700     1700             
============================================
+ Hits            7136     7179     +43     
+ Misses          6328     6283     -45     
- Partials         687      689      +2
Impacted Files Coverage Δ Complexity Δ
...in/java/io/seata/server/session/SessionHolder.java 59.49% <ø> (+6.32%) 16 <0> (+1) ⬆️
...o/seata/server/coordinator/DefaultCoordinator.java 50% <100%> (+5.28%) 28 <0> (+2) ⬆️
...java/io/seata/server/lock/memory/MemoryLocker.java 85.22% <0%> (-2.28%) 20% <0%> (-1%)
...a/server/session/file/FileBasedSessionManager.java 55.35% <0%> (+3.57%) 22% <0%> (+2%) ⬆️
...server/store/file/FileTransactionStoreManager.java 60.19% <0%> (+6.57%) 29% <0%> (+2%) ⬆️
...io/seata/server/session/DefaultSessionManager.java 95.23% <0%> (+9.52%) 8% <0%> (+1%) ⬆️
.../server/store/AbstractTransactionStoreManager.java 50% <0%> (+25%) 2% <0%> (+1%) ⬆️

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 2ded19c...20ab9c6. Read the comment docs.

Copy link
Member

@slievrly slievrly 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
Member

@xingfudeshi xingfudeshi left a comment

Choose a reason for hiding this comment

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

LGTM.Testing passed.

@zjinlei zjinlei merged commit 1020433 into apache:develop Oct 17, 2019
dangquocbang pushed a commit to dangquocbang/seata that referenced this pull request Oct 22, 2019
* 'develop' of https://github.com/seata/seata:
  feature:support gRpc (apache#1492)
  bugfix:fix auto proxy for multiple-datasource does not work (apache#1793)
  optimize: increase rm code coverage by db mock (apache#1674)
  bugfix: mysql can not get primary key value (apache#1788)
  bugfix: jdk 11 remoteAddress is null (apache#1764)
  test: verify that the analysis of the cause of issue 1702 is correct (apache#1710)
  optimize: seata server register eureka instance id (apache#1790)
  optimize: put message to logQueue (apache#1760)
  optimize:optimize rpc remoting log(apache#1787)
  optimize: simplify code (apache#1786)
  version: change version to 1.0.0-SNAPSHOT (apache#1785)
  bugfix: clean up resources in time to avoid mutual influence between unit tests (apache#1778)
  optimize:remove unused method (apache#1766)
  bugfix: DeleteExecutor. buildBeforeImageSQL keyword checker by db type (apache#1777)
  optimize: string splice and release lock (apache#1770)
  release 0.9.0 (apache#1771)
  bugfix: oracle rollback failed when the table has null Blob Clob value (apache#1761)
  bugfix: service method not support interface type parameter (apache#1759)
  optimize: abstract table meta cache (apache#1750)
  optimize: improve the efficiency of the batch log (apache#1743)
@slievrly slievrly added this to the 1.0 milestone Dec 2, 2019
@ggndnn ggndnn deleted the fix_1702 branch May 30, 2020 05:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

unit test failure on java 11 environment
5 participants