From 01786d0cd3820051fa9f9a860896c0b115f9ff38 Mon Sep 17 00:00:00 2001 From: Eugene Yokota Date: Wed, 4 Sep 2024 13:58:52 -0400 Subject: [PATCH] flush? --- src/test/java/org/scalasbt/ipcsocket/SocketTest.java | 7 +++++++ src/test/java/org/scalasbt/ipcsocket/duplex/Sender.java | 1 + 2 files changed, 8 insertions(+) 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) {