This is an automated email from the ASF dual-hosted git repository.
yuqi4733 pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/gravitino.git
The following commit(s) were added to refs/heads/main by this push:
new b8a2349ba6 [#6392] fix(test): SparkJdbcMysqlCatalogIT33 failed in some
enviroment (#6432)
b8a2349ba6 is described below
commit b8a2349ba6692712a4ddc6678b28877f363bfdca
Author: FANNG <[email protected]>
AuthorDate: Thu Feb 27 19:47:09 2025 +0800
[#6392] fix(test): SparkJdbcMysqlCatalogIT33 failed in some enviroment
(#6432)
### What changes were proposed in this pull request?
I'm not sure the root reason, seems MYSQL JDBC driver was not loaded
automatically in some condition, in this PR, load Mysql driver
explicitly.
### Why are the changes needed?
Fix: #6392
### Does this PR introduce _any_ user-facing change?
no
### How was this patch tested?
test in local machine.
---------
Co-authored-by: Qi Yu <[email protected]>
---
.../gravitino/integration/test/container/MySQLContainer.java | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git
a/integration-test-common/src/test/java/org/apache/gravitino/integration/test/container/MySQLContainer.java
b/integration-test-common/src/test/java/org/apache/gravitino/integration/test/container/MySQLContainer.java
index cc5cd53ab5..55f4549434 100644
---
a/integration-test-common/src/test/java/org/apache/gravitino/integration/test/container/MySQLContainer.java
+++
b/integration-test-common/src/test/java/org/apache/gravitino/integration/test/container/MySQLContainer.java
@@ -119,6 +119,14 @@ public class MySQLContainer extends BaseContainer {
StringUtils.substring(
getJdbcUrl(testDatabaseName), 0,
getJdbcUrl(testDatabaseName).lastIndexOf("/"));
+ // Fix https://github.com/apache/gravitino/issues/6392, MYSQL JDBC driver
may not load
+ // automatically.
+ try {
+ Class.forName("com.mysql.jdbc.Driver");
+ } catch (Exception e) {
+ throw new RuntimeException("Failed to load MySQL JDBC driver", e);
+ }
+
// change password for root user, Gravitino API must set password in
catalog properties
try (Connection connection =
DriverManager.getConnection(mySQLJdbcUrl, USER_NAME,
getPassword());