From 60443dd28f54d7ae1ace811ad677736093c113c5 Mon Sep 17 00:00:00 2001 From: Cedric Champeau Date: Thu, 30 Nov 2023 22:26:04 +0100 Subject: [PATCH] Upgrade to test resources 2.3.0 --- gradle/libs.versions.toml | 2 +- .../testresources/StartTestResourcesService.java | 12 ++++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index dd240449..5cb6b2ff 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -11,7 +11,7 @@ alpine="3.16" graalvmPlugin = "0.9.28" micronaut-platform = "4.2.0" # This is the platform version, used in our tests micronaut-aot = "2.1.1" -micronaut-testresources = "2.2.0" +micronaut-testresources = "2.3.0" micronaut-openapi = "6.2.2" log4j2 = { require = "2.17.1", reject = ["]0, 2.17["] } jetbrains-annotations = "24.1.0" diff --git a/test-resources-plugin/src/main/java/io/micronaut/gradle/testresources/StartTestResourcesService.java b/test-resources-plugin/src/main/java/io/micronaut/gradle/testresources/StartTestResourcesService.java index e9f0bad9..8c2eafc0 100644 --- a/test-resources-plugin/src/main/java/io/micronaut/gradle/testresources/StartTestResourcesService.java +++ b/test-resources-plugin/src/main/java/io/micronaut/gradle/testresources/StartTestResourcesService.java @@ -117,6 +117,17 @@ public abstract class StartTestResourcesService extends DefaultTask { @Optional public abstract Property getClientTimeout(); + /** + * Server idle timeout, in minutes. If the server + * doesn't receive any request for this amount of + * time, it will stop itself. + * + * @return the server idle timeout + */ + @Input + @Optional + public abstract Property getServerIdleTimeoutMinutes(); + /** * Allows starting the test server in foreground * instead of background, in which case the build @@ -228,6 +239,7 @@ public void waitFor(Duration duration) throws InterruptedException { cdsDir, getClasspath().getFiles(), getClientTimeout().getOrNull(), + getServerIdleTimeoutMinutes().getOrNull(), serverFactory); }