diff --git a/integration-test-common/src/test/java/com/datastrato/gravitino/integration/test/container/ContainerSuite.java b/integration-test-common/src/test/java/com/datastrato/gravitino/integration/test/container/ContainerSuite.java index e2344ab0928..f3c2c0cf37e 100644 --- a/integration-test-common/src/test/java/com/datastrato/gravitino/integration/test/container/ContainerSuite.java +++ b/integration-test-common/src/test/java/com/datastrato/gravitino/integration/test/container/ContainerSuite.java @@ -152,6 +152,13 @@ public HiveContainer getHiveContainer() { return hiveContainer; } + public void stopHiveContainer() { + if (hiveContainer != null) { + hiveContainer.close(); + hiveContainer = null; + } + } + public DorisContainer getDorisContainer() { return dorisContainer; } diff --git a/integration-test/src/test/java/com/datastrato/gravitino/integration/test/spark/SparkEnvIT.java b/integration-test/src/test/java/com/datastrato/gravitino/integration/test/spark/SparkEnvIT.java index fb8aa4900ab..963c38e5c84 100644 --- a/integration-test/src/test/java/com/datastrato/gravitino/integration/test/spark/SparkEnvIT.java +++ b/integration-test/src/test/java/com/datastrato/gravitino/integration/test/spark/SparkEnvIT.java @@ -75,6 +75,11 @@ void stop() { if (sparkSession != null) { sparkSession.close(); } + try { + containerSuite.stopHiveContainer(); + } catch (Exception e) { + LOG.error(e.getMessage(), e); + } } private void initMetalakeAndCatalogs() {