diff --git a/src/test/java/org/scalasbt/ipcsocket/SocketTest.java b/src/test/java/org/scalasbt/ipcsocket/SocketTest.java index bd9e2c9..cc80c1f 100644 --- a/src/test/java/org/scalasbt/ipcsocket/SocketTest.java +++ b/src/test/java/org/scalasbt/ipcsocket/SocketTest.java @@ -24,6 +24,8 @@ public class SocketTest extends BaseSocketSetup { public void testAssertEquals() throws IOException, InterruptedException { withSocket( sock -> { + System.out.println("SocketTest#testAssertEquals"); + ServerSocket serverSocket = newServerSocket(sock); CompletableFuture server = @@ -54,6 +56,8 @@ public void testAssertEquals() throws IOException, InterruptedException { public void throwIOExceptionOnMissingFile() throws IOException, InterruptedException { withSocket( sock -> { + System.out.println("SocketTest#throwIOExceptionOnMissingFile"); + boolean caughtIOException = false; Files.deleteIfExists(Paths.get(sock)); try { @@ -70,6 +74,8 @@ public void throwIOExceptionOnMissingFile() throws IOException, InterruptedExcep public void shortReadWrite() throws IOException, InterruptedException { withSocket( sock -> { + System.out.println("SocketTest#shortReadWrite"); + ServerSocket serverSocket = newServerSocket(sock); CompletableFuture server = @@ -91,6 +97,7 @@ public void shortReadWrite() throws IOException, InterruptedException { byte[] printedBytes = printed.getBytes(); out.write(printedBytes, 0, 4); out.write(printedBytes, 4, 5); + out.flush(); byte[] buf = new byte[16]; assertEquals("Did not read 4 bytes", in.read(buf, 0, 4), 4); assertEquals("Did not read 5 bytes", in.read(buf, 4, 6), 5); diff --git a/src/test/java/org/scalasbt/ipcsocket/duplex/Sender.java b/src/test/java/org/scalasbt/ipcsocket/duplex/Sender.java index 2f5041d..8cea8d4 100644 --- a/src/test/java/org/scalasbt/ipcsocket/duplex/Sender.java +++ b/src/test/java/org/scalasbt/ipcsocket/duplex/Sender.java @@ -24,6 +24,7 @@ public void run() { for (int i = 0; i < sendMessages; i++) { System.out.println("[" + name + "] sending msg: " + i); out.println("hello" + i); + out.flush(); Thread.sleep(Math.abs(random.nextInt(1000))); } } catch (IOException | InterruptedException e) {