From 75571271baaf9c12b8234a0790070a8afaa2a984 Mon Sep 17 00:00:00 2001 From: "Mateusz \"Serafin\" Gajewski" Date: Thu, 30 Mar 2023 17:17:02 +0200 Subject: [PATCH] Ensure that TestingHydraIdentityProvider is releasing resources --- .../security/oauth2/TestingHydraIdentityProvider.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/core/trino-main/src/test/java/io/trino/server/security/oauth2/TestingHydraIdentityProvider.java b/core/trino-main/src/test/java/io/trino/server/security/oauth2/TestingHydraIdentityProvider.java index 6bd7085b728d..3ed19b907ede 100644 --- a/core/trino-main/src/test/java/io/trino/server/security/oauth2/TestingHydraIdentityProvider.java +++ b/core/trino-main/src/test/java/io/trino/server/security/oauth2/TestingHydraIdentityProvider.java @@ -30,6 +30,7 @@ import io.trino.server.testing.TestingTrinoServer; import io.trino.server.ui.OAuth2WebUiAuthenticationFilter; import io.trino.server.ui.WebUiModule; +import io.trino.testing.ResourcePresence; import io.trino.util.AutoCloseableCloser; import okhttp3.Credentials; import okhttp3.FormBody; @@ -369,6 +370,12 @@ private static void runTestServer(boolean useJwt) } } + @ResourcePresence + public boolean isRunning() + { + return hydraContainer.getContainerId() != null || databaseContainer.getContainerId() != null || migrationContainer.getContainerId() != null; + } + public static void main(String[] args) throws Exception {