From 25cf7c61602ffea08d9ae83565659ce7f9c29a04 Mon Sep 17 00:00:00 2001 From: Georgios Andrianakis Date: Wed, 21 Sep 2022 11:30:39 +0300 Subject: [PATCH] Ensure that @QuarkusIntegrationTest does not leave dandling processes Fixes: #28114 --- .../main/java/io/quarkus/test/common/DefaultJarLauncher.java | 2 +- .../java/io/quarkus/test/common/DefaultNativeImageLauncher.java | 2 +- .../src/main/java/io/quarkus/test/common/LauncherUtil.java | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/test-framework/common/src/main/java/io/quarkus/test/common/DefaultJarLauncher.java b/test-framework/common/src/main/java/io/quarkus/test/common/DefaultJarLauncher.java index 10958e167ad83..c2bc57724a5d2 100644 --- a/test-framework/common/src/main/java/io/quarkus/test/common/DefaultJarLauncher.java +++ b/test-framework/common/src/main/java/io/quarkus/test/common/DefaultJarLauncher.java @@ -165,6 +165,6 @@ public void includeAsSysProps(Map systemProps) { @Override public void close() { - quarkusProcess.destroy(); + LauncherUtil.destroyProcess(quarkusProcess); } } diff --git a/test-framework/common/src/main/java/io/quarkus/test/common/DefaultNativeImageLauncher.java b/test-framework/common/src/main/java/io/quarkus/test/common/DefaultNativeImageLauncher.java index e61359e020238..33345980da115 100644 --- a/test-framework/common/src/main/java/io/quarkus/test/common/DefaultNativeImageLauncher.java +++ b/test-framework/common/src/main/java/io/quarkus/test/common/DefaultNativeImageLauncher.java @@ -267,6 +267,6 @@ public void includeAsSysProps(Map systemProps) { @Override public void close() { - quarkusProcess.destroy(); + LauncherUtil.destroyProcess(quarkusProcess); } } diff --git a/test-framework/common/src/main/java/io/quarkus/test/common/LauncherUtil.java b/test-framework/common/src/main/java/io/quarkus/test/common/LauncherUtil.java index d07cf27b0016a..76c2701fadded 100644 --- a/test-framework/common/src/main/java/io/quarkus/test/common/LauncherUtil.java +++ b/test-framework/common/src/main/java/io/quarkus/test/common/LauncherUtil.java @@ -110,7 +110,7 @@ private static void ensureProcessIsAlive(Process quarkusProcess) { * Try to destroy the process normally a few times * and resort to forceful destruction if necessary */ - private static void destroyProcess(Process quarkusProcess) { + static void destroyProcess(Process quarkusProcess) { quarkusProcess.destroy(); int i = 0; while (i++ < 10) {