From 370de7c44652fe461067e1ac64c38a1014584ae0 Mon Sep 17 00:00:00 2001 From: Norman Maurer Date: Tue, 19 Jun 2018 08:11:10 +0200 Subject: [PATCH] Revert "Ignore some test-flakiness when using Java11+ due outstanding Java11 bug. (#7984)" (#8035) Motivation: This reverts commit 4b728cd5bc53195bced516f33a1ea0a0def5604e as it was fixes in Java 11 ea+17. Modification: Revert previous added workaround as this is fixed in Java 11 now. Result: No more workaround for test included. --- .../socket/SocketHalfClosedTest.java | 19 +++++-------------- 1 file changed, 5 insertions(+), 14 deletions(-) diff --git a/testsuite/src/main/java/io/netty/testsuite/transport/socket/SocketHalfClosedTest.java b/testsuite/src/main/java/io/netty/testsuite/transport/socket/SocketHalfClosedTest.java index 3576414e0911..cd03ac3c9be7 100644 --- a/testsuite/src/main/java/io/netty/testsuite/transport/socket/SocketHalfClosedTest.java +++ b/testsuite/src/main/java/io/netty/testsuite/transport/socket/SocketHalfClosedTest.java @@ -33,9 +33,7 @@ import io.netty.channel.socket.ChannelInputShutdownReadComplete; import io.netty.channel.socket.ChannelOutputShutdownEvent; import io.netty.channel.socket.DuplexChannel; -import io.netty.channel.socket.oio.OioSocketChannel; import io.netty.util.UncheckedBooleanSupplier; -import io.netty.util.internal.PlatformDependent; import org.junit.Test; import java.util.concurrent.CountDownLatch; @@ -416,26 +414,19 @@ public void userEventTriggered(ChannelHandlerContext ctx, Object evt) { @Override public void channelInactive(ChannelHandlerContext ctx) { - checkPrematureClose(ctx); + checkPrematureClose(); } @Override public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) { ctx.close(); - checkPrematureClose(ctx); + checkPrematureClose(); } - private void checkPrematureClose(ChannelHandlerContext ctx) { + private void checkPrematureClose() { if (bytesRead < expectedBytes || !seenOutputShutdown) { - if (ctx.channel() instanceof OioSocketChannel && seenOutputShutdown - && PlatformDependent.javaVersion() >= 11) { - // If we are using OIO and are using Java11 this is expected atm. - // See http://mail.openjdk.java.net/pipermail/net-dev/2018-May/011511.html. - doneLatch.countDown(); - } else { - causeRef.set(new IllegalStateException("leader premature close")); - doneLatch.countDown(); - } + causeRef.set(new IllegalStateException("leader premature close")); + doneLatch.countDown(); } } }