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: when run server Module ServerTest failed, it occur "hostname can't be null" errors. see issue #743 #907

Merged
merged 6 commits into from
Apr 28, 2019

Conversation

codewaltz1994
Copy link
Contributor

Ⅰ. Describe what this PR did

FixBug #743
When run server Module ServerTest failed, it occur "hostname can't be null" errors. see issue seata#743. According to logics in server.class just add XID set* ops into ServerTest class, then bug is free.

Ⅱ. Does this pull request fix one issue?

fixes #743

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

Because this bug occur in a test class

Ⅳ. Describe how to verify it

just run ServerTest before and after this bugfix.

Ⅴ. Special notes for reviews

…can't be null" errors. see issue apache#743. According to logics in server.class just add XID set* ops into ServerTest class, then bug is free.
@codecov-io
Copy link

codecov-io commented Apr 25, 2019

Codecov Report

Merging #907 into develop will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##             develop     #907   +/-   ##
==========================================
  Coverage      38.33%   38.33%           
  Complexity      1033     1033           
==========================================
  Files            222      222           
  Lines           8664     8664           
  Branches        1048     1048           
==========================================
  Hits            3321     3321           
  Misses          4950     4950           
  Partials         393      393

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 07eac3f...888a002. Read the comment docs.

@@ -42,8 +43,9 @@ public static void main(String[] args) {
RpcServer rpcServer = new RpcServer(workingThreads);
rpcServer.setHandler(new DefaultCoordinator(rpcServer));
Copy link
Contributor

Choose a reason for hiding this comment

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

please change this class to a test case, not main method.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hi, according to your advice, I have done with it. but in server module , the original authors's tests used the Main method, you can view the original code for this , so I want to know that we need to be consistent with him, or should just fix the bug. THX.

Copy link
Member

Choose a reason for hiding this comment

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

please change this class to a test case, not main method.

for this situation,i thinks it's not necessary to use @Test.otherwise,the server will never be closed.

Copy link
Contributor

Choose a reason for hiding this comment

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

you can use @ after to shutdown the test server

Copy link
Member

Choose a reason for hiding this comment

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

after the server started,the main thread will be block, the @after will not get a chance to execute.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@xingfudeshi Then should I change the @test method back to Main method which the original author does, and we just focus on the bugfix?

Copy link
Member

Choose a reason for hiding this comment

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

yes.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@xingfudeshi It had already done.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@leizhiyuan Hi, Add @test and @after method seem not suitable for this case, No as good as we focus on bugfix. So I change back into Main mothod as the original author does.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@leizhiyuan Hi, since we have common in changes after we discussed before, please approve these changes, not request changes. after this, changes can be merge into develop branch, I think. Thanks all

…can't be null" errors. see issue apache#743. According to logics in server.class just add XID set* ops into ServerTest class, then bug is free.

Change: Change ServerTest main method into Test case method.
@xingfudeshi xingfudeshi self-requested a review April 26, 2019 06:34
…can't be null" errors. see issue apache#743. According to logics in server.class just add XID set* ops into ServerTest class, then bug is free.

Change: After discussion,when use @test method,It introduces unnecessary content and there is no very effective solution ,SO just focus on bugfux Change Test case method back into Main method.
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.

Thanks.LGTM.

@leizhiyuan
Copy link
Contributor

LGTM

Copy link
Contributor

@CoffeeLatte007 CoffeeLatte007 left a comment

Choose a reason for hiding this comment

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

Thanks! LGTM

@CoffeeLatte007 CoffeeLatte007 merged commit 71ae40d into apache:develop Apr 28, 2019
@codewaltz1994
Copy link
Contributor Author

Thanks all of you. It's my pleasure.

nick-tan pushed a commit to nick-tan/seata that referenced this pull request Jul 12, 2019
…can't be null" errors. see issue apache#743 (apache#907)

* bugfix: when run server Module ServerTest failed, it occur "hostname can't be null" errors. see issue apache#743. According to logics in server.class just add XID set* ops into ServerTest class, then bug is free.
@wangliang181230 wangliang181230 added this to the 0.5.* milestone Aug 9, 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.

The server Module ServerTest failed, it occur "hostname can't be null" errors
6 participants