From e0980f4aff1094059510e17a05bdb438aacd4637 Mon Sep 17 00:00:00 2001 From: Alex Archambault Date: Fri, 9 Jun 2023 01:39:39 +0200 Subject: [PATCH 1/3] Don't let Scala CLI start a Bloop server To save memory on the CI --- .../src/main/scala/almond/integration/Tests.scala | 1 + 1 file changed, 1 insertion(+) diff --git a/modules/scala/test-definitions/src/main/scala/almond/integration/Tests.scala b/modules/scala/test-definitions/src/main/scala/almond/integration/Tests.scala index 6a3212288..07d55abd6 100644 --- a/modules/scala/test-definitions/src/main/scala/almond/integration/Tests.scala +++ b/modules/scala/test-definitions/src/main/scala/almond/integration/Tests.scala @@ -467,6 +467,7 @@ object Tests { scalaCliLauncher.toString, "--power", "compile", + "--server=false", "--print-class-path", "." ) From 3d1a1c110bdaa6691fd9a38bf359302fabbb59d9 Mon Sep 17 00:00:00 2001 From: Alex Archambault Date: Fri, 9 Jun 2023 11:20:24 +0200 Subject: [PATCH 2/3] Add logging / checks when spawning kernel in ITs --- .../src/main/scala/almond/integration/KernelLauncher.scala | 1 + .../launcher/src/main/scala/almond/launcher/Launcher.scala | 2 ++ 2 files changed, 3 insertions(+) diff --git a/modules/scala/integration/src/main/scala/almond/integration/KernelLauncher.scala b/modules/scala/integration/src/main/scala/almond/integration/KernelLauncher.scala index ac3dcb64b..717fd3bfa 100644 --- a/modules/scala/integration/src/main/scala/almond/integration/KernelLauncher.scala +++ b/modules/scala/integration/src/main/scala/almond/integration/KernelLauncher.scala @@ -485,6 +485,7 @@ class KernelLauncher( else Map.empty[String, String] + assert(proc == null) proc = os.proc(command).spawn( cwd = dir, env = extraEnv ++ specExtraEnv, diff --git a/modules/scala/launcher/src/main/scala/almond/launcher/Launcher.scala b/modules/scala/launcher/src/main/scala/almond/launcher/Launcher.scala index 3a1148e58..436e245cc 100644 --- a/modules/scala/launcher/src/main/scala/almond/launcher/Launcher.scala +++ b/modules/scala/launcher/src/main/scala/almond/launcher/Launcher.scala @@ -205,6 +205,7 @@ object Launcher extends CaseApp[LauncherOptions] { setDaemon(true) override def run(): Unit = if (p.isAlive()) { + System.err.println("Shutting down underlying kernel") p.close() val timeout = 500.millis if (!p.waitFor(timeout.toMillis)) { @@ -213,6 +214,7 @@ object Launcher extends CaseApp[LauncherOptions] { ) p.destroyForcibly() } + System.err.println("Shut down underlying kernel") } } Runtime.getRuntime.addShutdownHook(hook) From e5f7a7a228538080aa5cbebfff68b615ac0854bf Mon Sep 17 00:00:00 2001 From: Alex Archambault Date: Thu, 15 Jun 2023 10:30:36 +0200 Subject: [PATCH 3/3] Just in case --- .../src/main/scala/almond/integration/KernelLauncher.scala | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/modules/scala/integration/src/main/scala/almond/integration/KernelLauncher.scala b/modules/scala/integration/src/main/scala/almond/integration/KernelLauncher.scala index 717fd3bfa..c2f3c072f 100644 --- a/modules/scala/integration/src/main/scala/almond/integration/KernelLauncher.scala +++ b/modules/scala/integration/src/main/scala/almond/integration/KernelLauncher.scala @@ -574,7 +574,8 @@ class KernelLauncher( res } finally { - runner0.close() + if (runner0 != null) + runner0.close() output.close(success = success, printOutputOnError = printOutputOnError) } }