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

Unstable UT: ZookeeperRegistryTest #1787

Closed
ralf0131 opened this issue May 12, 2018 · 4 comments
Closed

Unstable UT: ZookeeperRegistryTest #1787

ralf0131 opened this issue May 12, 2018 · 4 comments

Comments

@ralf0131
Copy link
Contributor

I've seen it at least twice, one can be found here

-------------------------------------------------------
 T E S T S
-------------------------------------------------------
Picked up _JAVA_OPTIONS: -Xmx2048m -Xms512m
Running com.alibaba.dubbo.registry.zookeeper.ZookeeperRegistryTest
log4j:WARN No appenders could be found for logger (com.alibaba.dubbo.common.logger.LoggerFactory).
log4j:WARN Please initialize the log4j system properly.
log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.
Tests run: 8, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 11.835 sec <<< FAILURE! - in com.alibaba.dubbo.registry.zookeeper.ZookeeperRegistryTest
testStatusChecker(com.alibaba.dubbo.registry.zookeeper.ZookeeperRegistryTest)  Time elapsed: 1.082 sec  <<< FAILURE!
java.lang.AssertionError: 

Expected: is <ERROR>
     but: was <OK>
	at com.alibaba.dubbo.registry.zookeeper.ZookeeperRegistryTest.testStatusChecker(ZookeeperRegistryTest.java:137)


Results :

Failed tests: 
  ZookeeperRegistryTest.testStatusChecker:137 
Expected: is <ERROR>
     but: was <OK>

Tests run: 8, Failures: 1, Errors: 0, Skipped: 0
@ralf0131
Copy link
Contributor Author

@htynkn Could you please take a look at it?

@htynkn
Copy link
Member

htynkn commented May 12, 2018

@ralf0131 I just checked this test case. I suggest delete this test testStatusChecker? I think this unstable unit test doesn't need to investigate.

This one is try to test RegistryStatusChecker, but RegistryStatusChecker is in another module, so the unit test I added in here is not the right place and it will not help increasing test coverage.

Currently, the implement way in my test case is depends on zk client behaviour, but in order to test RegistryStatusChecker, we should mock registry client object. We have task #1690 in issue list which can enhance RegistryStatusChecker in right place.

If you think it's make sense to delete it, I'm happy to create a pull request

@ralf0131
Copy link
Contributor Author

I've temporarily ignored this test case. We can refactor it in the future.

@htynkn
Copy link
Member

htynkn commented May 13, 2018

@ralf0131 cool thanks

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

No branches or pull requests

3 participants