Skip to content

Commit

Permalink
Revert "Ignore some test-flakiness when using Java11+ due outstanding…
Browse files Browse the repository at this point in the history
… Java11 bug. (netty#7984)" (netty#8035)

Motivation:

This reverts commit 4b728cd 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.
  • Loading branch information
normanmaurer authored Jun 19, 2018
1 parent 2d47005 commit 370de7c
Showing 1 changed file with 5 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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();
}
}
}
Expand Down

0 comments on commit 370de7c

Please sign in to comment.