Skip to content

World's most powerful open data catalog for building a high-performance, geo-distributed and federated metadata lake.

[#7406] fix(core): close H2 backend before deleting files to prevent file lock issues (#7391)

梁自强3e9080f67f9b
diff --git a/core/src/test/java/org/apache/gravitino/storage/relational/TestJDBCBackend.java b/core/src/test/java/org/apache/gravitino/storage/relational/TestJDBCBackend.java
index 507194671a..0e68c62f1b 100644
--- a/core/src/test/java/org/apache/gravitino/storage/relational/TestJDBCBackend.java
+++ b/core/src/test/java/org/apache/gravitino/storage/relational/TestJDBCBackend.java
@@ -144,6 +144,7 @@ public class TestJDBCBackend {
@AfterAll
public void tearDown() throws IOException {
dropAllTables();
+ backend.close();
File dir = new File(DB_DIR);
if (dir.exists()) {
Files.delete(Paths.get(DB_DIR));
@@ -151,7 +152,6 @@ public class TestJDBCBackend {
Files.delete(Paths.get(H2_FILE));
Files.delete(Paths.get(JDBC_STORE_PATH));
- backend.close();
}
@BeforeEach