Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions sjsonnet/client/src/sjsonnet/client/SjsonnetClientMain.java
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,13 @@ public static int run(String lockBase,

locks.serverLock.await();

// The server closes its end of the socket before releasing serverLock,
// so the output pumper will see EOF. Wait for it to finish so that all
// output is fully written to stdout/stderr before we exit. Without this
// join, System.exit() kills the daemon thread mid-pump, which can result
// in empty or truncated output (flaky test: secondInvocationReusesServer).
outThread.join(5_000);

try {
String content = Files.readString(Path.of(lockBase, "exitCode"), StandardCharsets.UTF_8);
return Integer.parseInt(content.trim());
Expand Down
Loading