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

test: fix the problem of unit test #3110

Merged
merged 46 commits into from
Sep 14, 2021
Merged

Conversation

LiWenGu
Copy link
Contributor

@LiWenGu LiWenGu commented Sep 11, 2020

Ⅰ. Describe what this PR did

fix the problem of unit test

Ⅱ. Does this pull request fix one issue?

fixes #3109

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

Ⅳ. Describe how to verify it

Ⅴ. Special notes for reviews

@lightClouds917
Copy link
Contributor

The CI failed .Please check .

[ERROR] Failures: 
[ERROR]   TmNettyClientTest.testSendMsgWithResponse:135 expected: <RuntimeException[SessionManager is NOT init!]> but was: <TransactionException[Could not found global transaction xid = 127.0.0.1:8091:1249853, may be has finished.]>
[INFO] 
[ERROR] Tests run: 84, Failures: 1, Errors: 0, Skipped: 4

@funky-eyes
Copy link
Contributor

mvn clean install -DskipTests=false -Dcheckstyle.skip=false -Dlicense.skip=false

please use this command to test locally

@slievrly
Copy link
Member

@LiWenGu
image

@LiWenGu
Copy link
Contributor Author

LiWenGu commented Sep 18, 2020

@LiWenGu
image

https://github.com/seata/seata/blob/772d55d912ffd03c0c8feb5e1670144b5530636c/server/src/main/java/io/seata/server/coordinator/AbstractCore.java#L115-L123
这个单元测试应该在117行就报错的,在119行报错,说明有其它的干扰,即 SessionHolder 已被 Thread 绑定。还有一个是错误日志还有个报错,是 java.net.BindException: Address already in use,说明这个单元测试的客户端请求是某个不知名的单元测试的服务端(服务端没有正确关闭)。所以我猜测有两个问题:

  1. SessionHolder 被干扰
  2. 服务端启动被干扰

@funky-eyes
Copy link
Contributor

请解决代码冲突

@codecov-commenter
Copy link

codecov-commenter commented Jun 27, 2021

Codecov Report

Merging #3110 (efc4847) into develop (129c2f3) will decrease coverage by 0.00%.
The diff coverage is n/a.

Impacted file tree graph

@@              Coverage Diff              @@
##             develop    #3110      +/-   ##
=============================================
- Coverage      49.59%   49.58%   -0.01%     
+ Complexity      3730     3729       -1     
=============================================
  Files            693      693              
  Lines          23402    23402              
  Branches        2899     2899              
=============================================
- Hits           11606    11604       -2     
- Misses         10631    10632       +1     
- Partials        1165     1166       +1     
Impacted Files Coverage Δ
...torage/file/store/FileTransactionStoreManager.java 56.12% <0.00%> (-0.65%) ⬇️

@slievrly slievrly changed the title optimize: fix the problem of unit test test: fix the problem of unit test Sep 14, 2021
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

@slievrly slievrly merged commit 2b1a0f3 into apache:develop Sep 14, 2021
@slievrly slievrly added this to the 1.5.0 milestone Sep 14, 2021
UmmizzZ pushed a commit to UmmizzZ/seata that referenced this pull request Sep 30, 2021
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 class TmNettyClientTest.java didn't get expected results
9 participants