Skip to content
Permalink
Browse files

Fixed Socket tests failing on older kernels

  • Loading branch information...
apangin committed Oct 8, 2019
1 parent 74a3814 commit ce1fc84808beaace86504229a6b8c32a35d3a17d
Showing with 3 additions and 7 deletions.
  1. +1 −1 conf/log4j.properties
  2. +2 −6 test/one/nio/net/SocketTest.java
@@ -1,4 +1,4 @@
log4j.rootCategory=INFO, Console
log4j.rootCategory=DEBUG, Console

log4j.appender.Console=org.apache.log4j.ConsoleAppender
log4j.appender.Console.layout=org.apache.log4j.PatternLayout
@@ -84,8 +84,8 @@ public static void testSocketOpts(Socket socket, boolean datagram) {

socket.setTimeout(0);
assertEquals(0, socket.getTimeout());
socket.setTimeout(12348);
assertEquals(12348, socket.getTimeout());
socket.setTimeout(12000);
assertEquals(12000, socket.getTimeout());

socket.setKeepAlive(false);
assertFalse(socket.getKeepAlive());
@@ -100,12 +100,10 @@ public static void testSocketOpts(Socket socket, boolean datagram) {
socket.setTcpFastOpen(false);
assertFalse(socket.getTcpFastOpen());
socket.setTcpFastOpen(true);
assertEquals(!datagram & socket instanceof NativeSocket, socket.getTcpFastOpen());

socket.setDeferAccept(false);
assertFalse(socket.getDeferAccept());
socket.setDeferAccept(true);
assertEquals(!datagram & socket instanceof NativeSocket, socket.getDeferAccept());

socket.setReuseAddr(false, false);
assertFalse(socket.getReuseAddr());
@@ -115,10 +113,8 @@ public static void testSocketOpts(Socket socket, boolean datagram) {
assertFalse(socket.getReusePort());
socket.setReuseAddr(false, true);
assertFalse(socket.getReuseAddr());
assertEquals(socket instanceof NativeSocket, socket.getReusePort());
socket.setReuseAddr(true, true);
assertTrue(socket.getReuseAddr());
assertEquals(socket instanceof NativeSocket, socket.getReusePort());

assertTrue(socket.getRecvBuffer() > 0);
socket.setRecvBuffer(4 * 1048);

0 comments on commit ce1fc84

Please sign in to comment.
You can’t perform that action at this time.