From b4bfd82b50e331a0720295e04402809ae2e1cf12 Mon Sep 17 00:00:00 2001 From: Rodin Aarssen Date: Tue, 10 Feb 2026 16:18:58 +0100 Subject: [PATCH 1/4] Added explicit ExecutorService to the IValue over jsonrpc tests --- test/org/rascalmpl/test/rpc/IValueOverJsonTests.java | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/test/org/rascalmpl/test/rpc/IValueOverJsonTests.java b/test/org/rascalmpl/test/rpc/IValueOverJsonTests.java index 115522aa92a..f009c8e922f 100644 --- a/test/org/rascalmpl/test/rpc/IValueOverJsonTests.java +++ b/test/org/rascalmpl/test/rpc/IValueOverJsonTests.java @@ -13,6 +13,7 @@ import java.util.Set; import java.util.concurrent.CompletableFuture; import java.util.concurrent.ExecutionException; +import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeoutException; @@ -72,6 +73,7 @@ public class IValueOverJsonTests { private JsonRpcTestInterface testServer; private final PipedInputStream is0, is1; private final PipedOutputStream os0, os1; + private final ExecutorService exec = Executors.newCachedThreadPool(); @Parameters(name="{0}") public static Iterable modesAndConfig() { @@ -92,7 +94,7 @@ public IValueOverJsonTests(ComplexTypeMode complexTypeMode, Consumer gsonCon .setInput(is) .setOutput(os) .configureGson(gsonConfig) - .setExecutorService(Executors.newCachedThreadPool()) + .setExecutorService(exec) .create(); clientLauncher.startListening(); @@ -135,11 +138,13 @@ static class TestThread extends Thread { private final InputStream is; private final OutputStream os; private final Consumer gsonConfig; + private final ExecutorService exec; - public TestThread(InputStream is, OutputStream os, Consumer gsonConfig) { + public TestThread(InputStream is, OutputStream os, Consumer gsonConfig, ExecutorService exec) { this.is = is; this.os = os; this.gsonConfig = gsonConfig; + this.exec = exec; this.setDaemon(true); } @@ -155,6 +160,7 @@ public void run() { System.err.println(e); return new ResponseError(ResponseErrorCode.InternalError, e.getMessage(), e); }) + .setExecutorService(exec) .create(); serverLauncher.startListening(); From d44613b14ec8af8e316a81618f099dbdda5f5b27 Mon Sep 17 00:00:00 2001 From: Rodin Aarssen Date: Tue, 10 Feb 2026 16:20:02 +0100 Subject: [PATCH 2/4] Aligned the order of the launcher arguments between the two instances in the IValue over jsonrpc tests --- test/org/rascalmpl/test/rpc/IValueOverJsonTests.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/test/org/rascalmpl/test/rpc/IValueOverJsonTests.java b/test/org/rascalmpl/test/rpc/IValueOverJsonTests.java index f009c8e922f..f82990a1997 100644 --- a/test/org/rascalmpl/test/rpc/IValueOverJsonTests.java +++ b/test/org/rascalmpl/test/rpc/IValueOverJsonTests.java @@ -121,11 +121,15 @@ public void teardown() throws IOException { class TestClient { public TestClient(InputStream is, OutputStream os, Consumer gsonConfig) { Launcher clientLauncher = new Launcher.Builder() - .setRemoteInterface(JsonRpcTestInterface.class) .setLocalService(this) + .setRemoteInterface(JsonRpcTestInterface.class) .setInput(is) .setOutput(os) .configureGson(gsonConfig) + .setExceptionHandler(e -> { + System.err.println(e); + return new ResponseError(ResponseErrorCode.InternalError, e.getMessage(), e); + }) .setExecutorService(exec) .create(); From 750073f5b12e8c8d2b6a118ed162381f165a4e9e Mon Sep 17 00:00:00 2001 From: Rodin Aarssen Date: Tue, 10 Feb 2026 16:20:10 +0100 Subject: [PATCH 3/4] Made field final --- test/org/rascalmpl/test/rpc/IValueOverJsonTests.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/org/rascalmpl/test/rpc/IValueOverJsonTests.java b/test/org/rascalmpl/test/rpc/IValueOverJsonTests.java index f82990a1997..15c16158bb2 100644 --- a/test/org/rascalmpl/test/rpc/IValueOverJsonTests.java +++ b/test/org/rascalmpl/test/rpc/IValueOverJsonTests.java @@ -171,7 +171,7 @@ public void run() { } } - private static Set asJsonObjectOrNotSupported = new HashSet<>(Arrays.asList(ComplexTypeMode.ENCODE_AS_JSON_OBJECT, ComplexTypeMode.NOT_SUPPORTED)); + private static final Set asJsonObjectOrNotSupported = new HashSet<>(Arrays.asList(ComplexTypeMode.ENCODE_AS_JSON_OBJECT, ComplexTypeMode.NOT_SUPPORTED)); private void runTestForPrimitiveType(String type, Supplier supplier, Function> function) { expectSuccessful(type, supplier, function); From 657895099e6e471d5322af8f1701f2638380f761 Mon Sep 17 00:00:00 2001 From: Rodin Aarssen Date: Tue, 10 Feb 2026 16:43:48 +0100 Subject: [PATCH 4/4] Replaced shutdownNow with shutdown --- test/org/rascalmpl/test/rpc/IValueOverJsonTests.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/org/rascalmpl/test/rpc/IValueOverJsonTests.java b/test/org/rascalmpl/test/rpc/IValueOverJsonTests.java index 15c16158bb2..417dadbe87d 100644 --- a/test/org/rascalmpl/test/rpc/IValueOverJsonTests.java +++ b/test/org/rascalmpl/test/rpc/IValueOverJsonTests.java @@ -103,7 +103,7 @@ public IValueOverJsonTests(ComplexTypeMode complexTypeMode, Consumer