Hi zhouxiaxiang, welcome to the openEuler Community.
I'm the Bot here serving you. You can find the instructions on how to interact with me at Here.
If you have any questions, please contact the SIG: sig-Java, and any of the maintainers: @雒海波 , @sinever , @chong_W , @rita_dong , @caodongxia , @xu_ping
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。
失败现象:
[INFO] Tests run: 7, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.262 s - in org.xnio.nio.test.NioTcpChannelTestCase
[ 127s] [INFO] Running org.xnio.nio.test.MultiThreadedNioTcpChannelTestCase
[ 128s] [INFO] Tests run: 7, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.443 s - in org.xnio.nio.test.MultiThreadedNioTcpChannelTestCase
[ 128s] [INFO] Running org.xnio.nio.test.XnioWorkerTestCase
[ 259s] [ERROR] Tests run: 27, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 131.837 s <<< FAILURE! - in org.xnio.nio.test.XnioWorkerTestCase
[ 259s] [ERROR] cancelAcceptTcpStream(org.xnio.nio.test.XnioWorkerTestCase) Time elapsed: 0.017 s <<< FAILURE!
[ 259s] java.lang.AssertionError
[ 259s] at org.junit.Assert.fail(Assert.java:86)
[ 259s] at org.junit.Assert.assertTrue(Assert.java:41)
[ 259s] at org.junit.Assert.assertNotNull(Assert.java:712)
[ 259s] at org.junit.Assert.assertNotNull(Assert.java:722)
[ 259s] at org.xnio.nio.test.XnioWorkerTestCase.cancelAcceptTcpStream(XnioWorkerTestCase.java:484)
[ 259s] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[ 259s] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
[ 259s] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[ 259s] at java.lang.reflect.Method.invoke(Method.java:498)
[ 259s] at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
[ 259s] at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
[ 259s] at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:52)
[ 259s] at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
[ 259s] at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
[ 259s] at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
[ 259s] at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
[ 259s] at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
[ 259s] at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
[ 259s] at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
[ 259s] at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
[ 259s] at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
[ 259s] at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
[ 259s] at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27)
[ 259s] at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
[ 259s] at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:365)
[ 259s] at org.apache.maven.surefire.junit4.JUnit4Provider.executeWithRerun(JUnit4Provider.java:273)
[ 259s] at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:238)
[ 259s] at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:159)
[ 259s] at org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoader(ForkedBooter.java:383)
[ 259s] at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:344)
[ 259s] at org.apache.maven.surefire.booter.ForkedBooter.execute(ForkedBooter.java:125)
[ 259s] at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:417)
[ 259s]
[ 259s] [INFO] Running org.xnio.nio.test.FileSystemWatcherTestCase
[ 259s] [INFO] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.03 s - in org.xnio.nio.test.FileSystemWatcherTestCase
[ 259s] [INFO] Running org.xnio.nio.test.NioUdpTestCase
[ 259s] [INFO] Tests run: 3, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.013 s - in org.xnio.nio.test.NioUdpTestCase
[ 259s] [INFO] Running org.xnio.nio.test.NioHalfDuplexChannelPipeTestCase
[ 260s] [INFO] Tests run: 4, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.12 s - in org.xnio.nio.test.NioHalfDuplexChannelPipeTestCase
[ 263s] [INFO]
[ 263s] [INFO] Results:
[ 263s] [INFO]
[ 263s] [ERROR] Failures:
[ 263s] [ERROR] XnioWorkerTestCase.cancelAcceptTcpStream:484
[ 263s] [INFO]
[ 263s] [ERROR] Tests run: 121, Failures: 1, Errors: 0, Skipped: 8
[ 263s] [INFO]
[ 263s] [INFO]
[ 263s] [INFO] ------------------------------------------------------------------------
[ 263s] [INFO] Skipping XNIO Parent POM
[ 263s] [INFO] This project has been banned from the build due to previous failures.
[ 263s] [INFO] ------------------------------------------------------------------------
[ 263s] [INFO] ------------------------------------------------------------------------
[ 263s] [INFO] Reactor Summary for XNIO Parent POM 3.4.0.Final:
[ 263s] [INFO]
[ 263s] [INFO] XNIO Parent POM .................................... SUCCESS [ 0.402 s]
[ 263s] [INFO] XNIO API ........................................... SUCCESS [ 57.444 s]
[ 263s] [INFO] XNIO NIO Implementation ............................ FAILURE [02:21 min]
[ 263s] [INFO] ------------------------------------------------------------------------
[ 263s] [INFO] BUILD FAILURE
该失败用例为:https://github.com/xnio/xnio/blob/3.4.0.Final/nio-impl/src/test/java/org/xnio/nio/test/XnioWorkerTestCase.java 第483行,如下:
464 @Test
465 public void cancelAcceptTcpStream() throws CancellationException, IOException {
466 final XnioWorker xnioWorker = xnio.createWorker(OptionMap.EMPTY);
467 final TestChannelListener<ConnectedStreamChannel> channelListener = new TestChannelListener<ConnectedStreamChannel>();
468 final TestChannelListener<BoundChannel> bindListener = new TestChannelListener<BoundChannel>();
469 final IoFuture<ConnectedStreamChannel> channelFuture = xnioWorker.acceptStream(bindAddress, channelListener, bindListener, OptionMap.EMPTY);
470 final IoFuture<ConnectedStreamChannel> connectedStreamChannel = xnioWorker.connectStream(bindAddress, null, OptionMap.EMPTY);
471
472 assertNotNull(connectedStreamChannel);
473 assertNotNull(channelFuture);
474
475 channelFuture.cancel();
476
477 CancellationException expected = null;
478 try {
479 channelFuture.get();
480 } catch (CancellationException e) {
481 expected = e;
482 }
483 assertNotNull(expected);
484
485 assertFalse(channelListener.isInvokedYet());
486 if (bindListener.isInvokedYet()) {
487 BoundChannel boundChannel = bindListener.getChannel();
488 assertNotNull(boundChannel);
489 assertFalse(boundChannel.isOpen());
490 }
491 }
失败的原因:channelFuture.cancel()执行失败,导致connectionFuture1.get()执行成功,从而expected为空,最终assertNotNull(expected)断言失败。
该测试用例根据环境的不同存在概率性失败,这种用例不保证100%成功,上游社区最新的解决办法是channelFuture.cancel()执行失败后重新执行一次,减少偶线失败的概率。
上游社区修改提交:https://github.com/xnio/xnio/commit/f4e4b053e29298be8df8941aefc93d82c0be2f1c
上游社区该提交在3.8.3版本合入,由于xnio上层依赖较多,升级影响较大,建议先跳过该用例。
登录 后才可以发表评论