Skip to content

Commit 1ecc053

Browse files
authored
Log specific exception to debug ParameterizedSslHandlerTest (#12290)
Motivation: We have been seeing this test fail intermittently on Windows for some time. The stack trace of the exception was supposed to be included in the test failure output, but we don't see it in practice. Modification: Add some logging to the test, so when it is about to fail, it will capture additional context in the log. Result: Hopefully we'll be able to debug this test in the future.
1 parent cf8b717 commit 1ecc053

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

handler/src/test/java/io/netty/handler/ssl/ParameterizedSslHandlerTest.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,8 @@
4747
import io.netty.util.concurrent.PromiseNotifier;
4848
import io.netty.util.internal.EmptyArrays;
4949
import io.netty.util.internal.ResourcesUtil;
50+
import io.netty.util.internal.logging.InternalLogger;
51+
import io.netty.util.internal.logging.InternalLoggerFactory;
5052
import org.junit.jupiter.api.Timeout;
5153
import org.junit.jupiter.params.ParameterizedTest;
5254
import org.junit.jupiter.params.provider.MethodSource;
@@ -636,6 +638,8 @@ private static SslHandler disableHandshakeTimeout(SslHandler handler) {
636638
}
637639

638640
private static final class ReentryWriteSslHandshakeHandler extends SimpleChannelInboundHandler<ByteBuf> {
641+
private static final InternalLogger LOGGER =
642+
InternalLoggerFactory.getInstance(ReentryWriteSslHandshakeHandler.class);
639643
private final String toWrite;
640644
private final StringBuilder readQueue;
641645
private final CountDownLatch doneLatch;
@@ -681,6 +685,7 @@ public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) {
681685
}
682686

683687
private void appendError(Throwable cause) {
688+
LOGGER.error(new Exception("Caught possible write failure in ParameterizedSslHandlerTest.", cause));
684689
readQueue.append("failed to write '").append(toWrite).append("': ");
685690

686691
ByteArrayOutputStream out = new ByteArrayOutputStream();

0 commit comments

Comments
 (0)