baidu / Jprotobuf-rpc-socket

Protobuf RPC是一种基于TCP协议的二进制RPC通信协议的Java实现
Apache License 2.0
530 stars 221 forks source link

增加对Spring 4.x的支持 #19

Closed LuciferYang closed 9 years ago

LuciferYang commented 9 years ago

对于4.x的支持相交对于3.x的支持会有比较大的差别吗?

xiemalin commented 9 years ago

理论上应该4.x兼容 3.x的, 只是需要一个完整性测试,后面会给出4.x的支持说明

LuciferYang commented 9 years ago

我先改改测一下

LuciferYang commented 9 years ago

只是改了版本,现在看是HaEchoServiceTest#testDynamicServerListChangesRemove和HaEchoServiceTest#testDynamicServerListChangesAdd这两个case挂掉了

xiemalin commented 9 years ago

异常信息可否贴出来?

xiemalin commented 9 years ago

4.1.7.RELEASE 版本测试case 都可以通过,请问你使用的版本是?

LuciferYang commented 9 years ago

4.1.7.RELEASE........

LuciferYang commented 9 years ago

那两个case最后断言的结果不对

LuciferYang commented 9 years ago

Test set: com.baidu.jprotobuf.pbrpc.client.ha.HaEchoServiceTest

Tests run: 5, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 36.303 sec <<< FAILURE! testDynamicServerListChangesAdd(com.baidu.jprotobuf.pbrpc.client.ha.HaEchoServiceTest) Time elapsed: 7.744 sec <<< FAILURE! java.lang.AssertionError: expected:<6> but was:<5> at org.junit.Assert.fail(Assert.java:93) at org.junit.Assert.failNotEquals(Assert.java:647) at org.junit.Assert.assertEquals(Assert.java:128) at org.junit.Assert.assertEquals(Assert.java:472) at org.junit.Assert.assertEquals(Assert.java:456) at com.baidu.jprotobuf.pbrpc.client.ha.HaEchoServiceTest.testDynamicServerListChangesAdd(HaEchoServiceTest.java:190) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:45) at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15) at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:42) at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20) at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28) 很不稳定 这个case和testDynamicServerListChangesRemove 这个都是最后的断言不对,还没有来的及看具体原因,而且不稳定,有时候交替出错误,是不是case本身有问题?

xiemalin commented 9 years ago

这个case的确存在不稳定的情况, 主要是看机器的性能,测试的负载均衡动态恢复的功能,建议你本地测试的时候,根据机器的性能 把sleep的时间进行调整,设置大一点 SleepUtils.dummySleep(2000);

LuciferYang commented 9 years ago

好的,那看来是可以平滑移植的了