Skip to content

Commit

Permalink
Merge pull request #318 from marekkopecky/LOGMGR-280
Browse files Browse the repository at this point in the history
[LOGMGR-280] SocketHandlerTests hangs on some JDKs
  • Loading branch information
jamezp authored Nov 1, 2021
2 parents bc13d3d + 4cb75f8 commit 46c9133
Showing 1 changed file with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import org.jboss.logmanager.formatters.PatternFormatter;
import org.jboss.logmanager.handlers.SocketHandler.Protocol;
import org.junit.Assert;
import org.junit.Assume;
import org.junit.Test;

/**
Expand All @@ -31,6 +32,11 @@ public class SocketHandlerTests extends AbstractHandlerTest {
private final int port;
private final int altPort;

// https://bugs.openjdk.java.net/browse/JDK-8219991
private final String JAVA_VERSION = System.getProperty("java.version");
private final String JDK_8219991_ERROR_MESSAGE = "https://bugs.openjdk.java.net/browse/JDK-8219991";
private final Boolean JDK_8219991 = JAVA_VERSION.startsWith("1.8") || (JAVA_VERSION.startsWith("11.0.8") && System.getProperty("java.vendor").contains("Oracle"));

public SocketHandlerTests() throws UnknownHostException {
address = InetAddress.getByName(System.getProperty("org.jboss.test.address", "127.0.0.1"));
port = Integer.parseInt(System.getProperty("org.jboss.test.port", Integer.toString(SocketHandler.DEFAULT_PORT)));
Expand Down Expand Up @@ -108,6 +114,7 @@ record = createLogRecord("Test TCP handler " + altPort);

@Test
public void testProtocolChange() throws Exception {
Assume.assumeFalse(JDK_8219991_ERROR_MESSAGE, JDK_8219991);
try (SocketHandler handler = createHandler(Protocol.TCP)) {
try (SimpleServer server = SimpleServer.createTcpServer(port)) {
final ExtLogRecord record = createLogRecord("Test TCP handler");
Expand Down Expand Up @@ -171,6 +178,7 @@ public void testTcpReconnect() throws Exception {

@Test
public void testTlsConfig() throws Exception {
Assume.assumeFalse(JDK_8219991_ERROR_MESSAGE, JDK_8219991);
try (SimpleServer server = SimpleServer.createTlsServer(port)) {
final LogContext logContext = LogContext.create();
final LogContextConfiguration logContextConfiguration = LogContextConfiguration.Factory.create(logContext);
Expand Down

0 comments on commit 46c9133

Please sign in to comment.